-
Notifications
You must be signed in to change notification settings - Fork 112
add liveness, readiness, and startup probes to noobaa-operator #1684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,13 @@ spec: | |
containers: | ||
- name: noobaa-operator | ||
image: NOOBAA_OPERATOR_IMAGE | ||
args: | ||
- operator | ||
- run | ||
- --health-probe-bind-address=:8081 | ||
ports: | ||
- name: healthz | ||
containerPort: 8081 | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
volumeMounts: | ||
- name: bound-sa-token | ||
mountPath: /var/run/secrets/openshift/serviceaccount | ||
|
@@ -50,6 +57,29 @@ spec: | |
# SHOULD BE RETURNED ONCE COSI IS BACK | ||
# - name: socket | ||
# mountPath: /var/lib/cosi | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: healthz | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 3 | ||
livenessProbe: | ||
httpGet: | ||
path: /readyz | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should all probes be the same? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we only perform ping, I suppose it's okay for them to be set to the same path. In the future, we might want to use more advanced probes, but for now, it's enough. |
||
port: healthz | ||
initialDelaySeconds: 15 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 3 | ||
startupProbe: | ||
Comment on lines
+60
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainUse /healthz for liveness; /readyz for readiness (current YAML uses /readyz for liveness). readinessProbe:
httpGet:
path: /readyz
port: healthz
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
- path: /readyz
+ path: /healthz
port: healthz
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3 🏁 Script executed: #!/usr/bin/env bash
set -e
# Locate the operator.yaml file
OP_FILE=$(fd --type f operator.yaml || true)
echo "Found file: $OP_FILE"
[ -n "$OP_FILE" ] || { echo "operator.yaml not found"; exit 1; }
# Print lines 60–76 for verification
sed -n '60,76p' "$OP_FILE" Length of output: 698 Use /healthz for livenessProbe 🤖 Prompt for AI Agents
|
||
httpGet: | ||
path: /readyz | ||
port: healthz | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 30 | ||
resources: | ||
limits: | ||
cpu: "250m" | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6189,7 +6189,7 @@ spec: | |||||||||||||||||||||||||||||||||
sourceNamespace: default | ||||||||||||||||||||||||||||||||||
` | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
const Sha256_deploy_operator_yaml = "aa8da1c289a05b3c94b9393b04307d38814a67625ac6a8006dace4d09366f35b" | ||||||||||||||||||||||||||||||||||
const Sha256_deploy_operator_yaml = "5b33c842b603ff507c385c1f65fc2b2e86a3f3e131fc2e2e216d1bb966c032e2" | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
const File_deploy_operator_yaml = `apiVersion: apps/v1 | ||||||||||||||||||||||||||||||||||
kind: Deployment | ||||||||||||||||||||||||||||||||||
|
@@ -6234,6 +6234,13 @@ spec: | |||||||||||||||||||||||||||||||||
containers: | ||||||||||||||||||||||||||||||||||
- name: noobaa-operator | ||||||||||||||||||||||||||||||||||
image: NOOBAA_OPERATOR_IMAGE | ||||||||||||||||||||||||||||||||||
args: | ||||||||||||||||||||||||||||||||||
- operator | ||||||||||||||||||||||||||||||||||
- run | ||||||||||||||||||||||||||||||||||
- --health-probe-bind-address=:8081 | ||||||||||||||||||||||||||||||||||
ports: | ||||||||||||||||||||||||||||||||||
- name: healthz | ||||||||||||||||||||||||||||||||||
containerPort: 8081 | ||||||||||||||||||||||||||||||||||
volumeMounts: | ||||||||||||||||||||||||||||||||||
- name: bound-sa-token | ||||||||||||||||||||||||||||||||||
mountPath: /var/run/secrets/openshift/serviceaccount | ||||||||||||||||||||||||||||||||||
|
@@ -6243,6 +6250,29 @@ spec: | |||||||||||||||||||||||||||||||||
# SHOULD BE RETURNED ONCE COSI IS BACK | ||||||||||||||||||||||||||||||||||
# - name: socket | ||||||||||||||||||||||||||||||||||
# mountPath: /var/lib/cosi | ||||||||||||||||||||||||||||||||||
readinessProbe: | ||||||||||||||||||||||||||||||||||
httpGet: | ||||||||||||||||||||||||||||||||||
path: /readyz | ||||||||||||||||||||||||||||||||||
port: healthz | ||||||||||||||||||||||||||||||||||
initialDelaySeconds: 5 | ||||||||||||||||||||||||||||||||||
periodSeconds: 10 | ||||||||||||||||||||||||||||||||||
timeoutSeconds: 5 | ||||||||||||||||||||||||||||||||||
failureThreshold: 3 | ||||||||||||||||||||||||||||||||||
livenessProbe: | ||||||||||||||||||||||||||||||||||
httpGet: | ||||||||||||||||||||||||||||||||||
path: /readyz | ||||||||||||||||||||||||||||||||||
port: healthz | ||||||||||||||||||||||||||||||||||
initialDelaySeconds: 15 | ||||||||||||||||||||||||||||||||||
periodSeconds: 10 | ||||||||||||||||||||||||||||||||||
timeoutSeconds: 5 | ||||||||||||||||||||||||||||||||||
failureThreshold: 3 | ||||||||||||||||||||||||||||||||||
startupProbe: | ||||||||||||||||||||||||||||||||||
Comment on lines
+6262
to
+6269
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Liveness probe should hit /healthz, not /readyz. controller-runtime exposes both /healthz and /readyz; liveness is expected to target /healthz. Pointing liveness to /readyz can mask unhealthy-but-ready states. Switch the path to /healthz. livenessProbe:
httpGet:
- path: /readyz
+ path: /healthz
port: healthz
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||
httpGet: | ||||||||||||||||||||||||||||||||||
path: /readyz | ||||||||||||||||||||||||||||||||||
port: healthz | ||||||||||||||||||||||||||||||||||
periodSeconds: 10 | ||||||||||||||||||||||||||||||||||
timeoutSeconds: 5 | ||||||||||||||||||||||||||||||||||
failureThreshold: 30 | ||||||||||||||||||||||||||||||||||
resources: | ||||||||||||||||||||||||||||||||||
limits: | ||||||||||||||||||||||||||||||||||
cpu: "250m" | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Trim trailing spaces and normalize args indentation.
Lines 45–46 have trailing spaces; fix to keep CI/yamllint green and avoid noisy diffs.
To verify no trailing spaces remain:
🏁 Script executed:
Length of output: 93
Trim trailing spaces in deploy/operator.yaml args
Lines 45–46 contain trailing spaces; remove them to keep CI/yamllint green.
🧰 Tools
🪛 YAMLlint (1.37.1)
[warning] 45-45: wrong indentation: expected 10 but found 12
(indentation)
[error] 45-45: trailing spaces
(trailing-spaces)
[error] 46-46: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents