Skip to content

Commit c8d1281

Browse files
authored
Merge pull request #666 from Danil-Grigorev/healthz-fix
🌱 Implement healthz and readyz checks in the deployment
2 parents d03c162 + fdd8506 commit c8d1281

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
@@ -123,6 +123,30 @@ spec:
123123
{{- toYaml . | nindent 12 }}
124124
{{- end }}
125125
terminationMessagePolicy: FallbackToLogsOnError
126+
{{- $healthAddr := $.Values.healthAddr }}
127+
{{- if contains ":" $healthAddr -}}
128+
{{ $healthAddr = ( split ":" $.Values.healthAddr)._1 | int }}
129+
{{- end }}
130+
livenessProbe:
131+
failureThreshold: 3
132+
httpGet:
133+
path: /healthz
134+
port: {{ $healthAddr | default 9440 }}
135+
scheme: HTTP
136+
initialDelaySeconds: 15
137+
periodSeconds: 20
138+
successThreshold: 1
139+
timeoutSeconds: 1
140+
readinessProbe:
141+
failureThreshold: 3
142+
httpGet:
143+
path: /readyz
144+
port: {{ $healthAddr | default 9440 }}
145+
scheme: HTTP
146+
initialDelaySeconds: 5
147+
periodSeconds: 10
148+
successThreshold: 1
149+
timeoutSeconds: 1
126150
terminationGracePeriodSeconds: 10
127151
{{- with .Values.volumes }}
128152
volumes:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ image:
2323
pullPolicy: IfNotPresent
2424
env:
2525
manager: []
26-
healthAddr: ":8081"
2726
diagnosticsAddress: ":8443"
27+
healthAddr: ":9440"
2828
insecureDiagnostics: false
2929
watchConfigSecret: false
3030
imagePullSecrets: {}

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
- --diagnostics-address=:8443
2839128391
- --leader-elect=true
2839228392
command:
@@ -28413,6 +28413,26 @@ spec:
2841328413
name: cert
2841428414
readOnly: true
2841528415
terminationMessagePolicy: FallbackToLogsOnError
28416+
livenessProbe:
28417+
failureThreshold: 3
28418+
httpGet:
28419+
path: /healthz
28420+
port: 9440
28421+
scheme: HTTP
28422+
initialDelaySeconds: 15
28423+
periodSeconds: 20
28424+
successThreshold: 1
28425+
timeoutSeconds: 1
28426+
readinessProbe:
28427+
failureThreshold: 3
28428+
httpGet:
28429+
path: /readyz
28430+
port: 9440
28431+
scheme: HTTP
28432+
initialDelaySeconds: 5
28433+
periodSeconds: 10
28434+
successThreshold: 1
28435+
timeoutSeconds: 1
2841628436
terminationGracePeriodSeconds: 10
2841728437
volumes:
2841828438
- name: cert

0 commit comments

Comments
 (0)