Skip to content

Commit 6e7b574

Browse files
Implement healthz and readyz checks in the deployment
Signed-off-by: Danil-Grigorev <[email protected]>
1 parent 57fd624 commit 6e7b574

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

hack/charts/cluster-api-operator/templates/deployment.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,30 @@ spec:
120120
{{- toYaml . | nindent 12 }}
121121
{{- end }}
122122
terminationMessagePolicy: FallbackToLogsOnError
123+
{{- $healthAddr := $.Values.healthAddr }}
124+
{{- if contains ":" $healthAddr -}}
125+
{{ $healthAddr = ( split ":" $.Values.healthAddr)._1 | int }}
126+
{{- end }}
127+
livenessProbe:
128+
failureThreshold: 3
129+
httpGet:
130+
path: /healthz
131+
port: {{ $healthAddr | default 9440 }}
132+
scheme: HTTP
133+
initialDelaySeconds: 15
134+
periodSeconds: 20
135+
successThreshold: 1
136+
timeoutSeconds: 1
137+
readinessProbe:
138+
failureThreshold: 3
139+
httpGet:
140+
path: /readyz
141+
port: {{ $healthAddr | default 9440 }}
142+
scheme: HTTP
143+
initialDelaySeconds: 5
144+
periodSeconds: 10
145+
successThreshold: 1
146+
timeoutSeconds: 1
123147
terminationGracePeriodSeconds: 10
124148
{{- with .Values.volumes }}
125149
volumes:

hack/charts/cluster-api-operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ image:
2323
pullPolicy: IfNotPresent
2424
env:
2525
manager: []
26-
healthAddr: ":8081"
26+
healthAddr: ":9440"
2727
metricsBindAddr: "127.0.0.1:8080"
2828
diagnosticsAddress: "8443"
2929
insecureDiagnostics: false

test/e2e/resources/full-chart-install.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28386,7 +28386,7 @@ spec:
2838628386
containers:
2838728387
- args:
2838828388
- --v=2
28389-
- --health-addr=:8081
28389+
- --health-addr=:9440
2839028390
- --metrics-bind-addr=127.0.0.1:8080
2839128391
- --diagnostics-address=8443
2839228392
- --leader-elect=true
@@ -28414,6 +28414,26 @@ spec:
2841428414
name: cert
2841528415
readOnly: true
2841628416
terminationMessagePolicy: FallbackToLogsOnError
28417+
livenessProbe:
28418+
failureThreshold: 3
28419+
httpGet:
28420+
path: /healthz
28421+
port: 9440
28422+
scheme: HTTP
28423+
initialDelaySeconds: 15
28424+
periodSeconds: 20
28425+
successThreshold: 1
28426+
timeoutSeconds: 1
28427+
readinessProbe:
28428+
failureThreshold: 3
28429+
httpGet:
28430+
path: /readyz
28431+
port: 9440
28432+
scheme: HTTP
28433+
initialDelaySeconds: 5
28434+
periodSeconds: 10
28435+
successThreshold: 1
28436+
timeoutSeconds: 1
2841728437
terminationGracePeriodSeconds: 10
2841828438
volumes:
2841928439
- name: cert

0 commit comments

Comments
 (0)