Skip to content
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

🌱 Implement healthz and readyz checks in the deployment #666

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions hack/charts/cluster-api-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,30 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
{{- $healthAddr := $.Values.healthAddr }}
{{- if contains ":" $healthAddr -}}
{{ $healthAddr = ( split ":" $.Values.healthAddr)._1 | int }}
{{- end }}
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: {{ $healthAddr | default 9440 }}
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /readyz
port: {{ $healthAddr | default 9440 }}
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
terminationGracePeriodSeconds: 10
{{- with .Values.volumes }}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion hack/charts/cluster-api-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ image:
pullPolicy: IfNotPresent
env:
manager: []
healthAddr: ":8081"
diagnosticsAddress: ":8443"
healthAddr: ":9440"
insecureDiagnostics: false
watchConfigSecret: false
imagePullSecrets: {}
Expand Down
22 changes: 21 additions & 1 deletion test/e2e/resources/full-chart-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28386,7 +28386,7 @@ spec:
containers:
- args:
- --v=2
- --health-addr=:8081
- --health-addr=:9440
- --diagnostics-address=:8443
- --leader-elect=true
command:
Expand All @@ -28413,6 +28413,26 @@ spec:
name: cert
readOnly: true
terminationMessagePolicy: FallbackToLogsOnError
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 9440
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /readyz
port: 9440
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
terminationGracePeriodSeconds: 10
volumes:
- name: cert
Expand Down
Loading