Skip to content

Commit ce0e8cf

Browse files
committed
Add separate liveness probe for operator container
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 8bf567e commit ce0e8cf

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

chart/openfaas/templates/gateway-dep.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ spec:
104104
- --tries=1
105105
- --timeout=5
106106
- --spider
107-
- http://localhost:8080/healthz
107+
- http://127.0.0.1:8080/healthz
108108
{{- end }}
109109
readinessProbe:
110110
{{- if $.Values.gateway.readinessProbe }}
@@ -126,7 +126,7 @@ spec:
126126
- --tries=1
127127
- --timeout=5
128128
- --spider
129-
- http://localhost:8080/healthz
129+
- http://127.0.0.1:8080/healthz
130130
{{- end }}
131131
env:
132132
{{- if .Values.gateway.logsProviderURL }}
@@ -366,6 +366,28 @@ spec:
366366
securityContext:
367367
{{- toYaml .Values.securityContext | nindent 10 }}
368368
{{- end }}
369+
livenessProbe:
370+
{{- if $.Values.operator.livenessProbe }}
371+
initialDelaySeconds: {{ $.Values.operator.livenessProbe.initialDelaySeconds | default 0 }}
372+
periodSeconds: {{ $.Values.operator.livenessProbe.periodSeconds | default 10 }}
373+
timeoutSeconds: {{ $.Values.operator.livenessProbe.timeoutSeconds | default 5 }}
374+
failureThreshold: {{ $.Values.operator.livenessProbe.failureThreshold | default 3 }}
375+
successThreshold: {{ $.Values.operator.livenessProbe.successThreshold | default 1 }}
376+
{{- end }}
377+
{{- if .Values.httpProbe }}
378+
httpGet:
379+
path: /healthz
380+
port: 8081
381+
{{- else }}
382+
exec:
383+
command:
384+
- wget
385+
- --quiet
386+
- --tries=1
387+
- --timeout=3
388+
- --spider
389+
- http://127.0.0.1:8081/healthz
390+
{{- end }}
369391
command:
370392
- ./faas-netes
371393
{{- if or .Values.openfaasPro .Values.oem }}

chart/openfaas/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ operator:
191191
# for debugging purposes
192192
pprof: false
193193

194+
# The liveness probe was added so that the operator can be restarted
195+
# if its watch connections to the Kubernetes API server are lost.
196+
livenessProbe:
197+
initialDelaySeconds: 5
198+
periodSeconds: 5
199+
timeoutSeconds: 3
200+
failureThreshold: 3
201+
successThreshold: 1
202+
194203
faasnetesPro:
195204
image: ghcr.io/openfaasltd/faas-netes:0.5.63
196205
logs:

0 commit comments

Comments
 (0)