Skip to content

Commit 2b9dbf1

Browse files
committed
make probes configurable
1 parent 7eee175 commit 2b9dbf1

File tree

6 files changed

+294
-32
lines changed

6 files changed

+294
-32
lines changed

hosting/k8s/helm/README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,108 @@ Health checks are configured for all services:
323323
- Database connection tests
324324
- Readiness and liveness probes
325325
326+
### Health Probe Configuration
327+
328+
All non-Bitnami services support configurable health probes:
329+
330+
```yaml
331+
# Webapp health probes
332+
webapp:
333+
livenessProbe:
334+
enabled: true
335+
initialDelaySeconds: 5
336+
periodSeconds: 5
337+
timeoutSeconds: 5
338+
failureThreshold: 5
339+
successThreshold: 1
340+
readinessProbe:
341+
enabled: true
342+
initialDelaySeconds: 5
343+
periodSeconds: 5
344+
timeoutSeconds: 1
345+
failureThreshold: 5
346+
successThreshold: 1
347+
startupProbe:
348+
enabled: false
349+
initialDelaySeconds: 0
350+
periodSeconds: 10
351+
timeoutSeconds: 5
352+
failureThreshold: 60
353+
successThreshold: 1
354+
355+
# Supervisor health probes
356+
supervisor:
357+
livenessProbe:
358+
enabled: true
359+
initialDelaySeconds: 5
360+
periodSeconds: 5
361+
timeoutSeconds: 5
362+
failureThreshold: 5
363+
successThreshold: 1
364+
readinessProbe:
365+
enabled: true
366+
initialDelaySeconds: 5
367+
periodSeconds: 5
368+
timeoutSeconds: 1
369+
failureThreshold: 5
370+
successThreshold: 1
371+
startupProbe:
372+
enabled: false
373+
initialDelaySeconds: 0
374+
periodSeconds: 10
375+
timeoutSeconds: 5
376+
failureThreshold: 60
377+
successThreshold: 1
378+
379+
# Electric health probes
380+
electric:
381+
livenessProbe:
382+
enabled: true
383+
initialDelaySeconds: 5
384+
periodSeconds: 5
385+
timeoutSeconds: 5
386+
failureThreshold: 5
387+
successThreshold: 1
388+
readinessProbe:
389+
enabled: true
390+
initialDelaySeconds: 5
391+
periodSeconds: 5
392+
timeoutSeconds: 1
393+
failureThreshold: 5
394+
successThreshold: 1
395+
startupProbe:
396+
enabled: false
397+
initialDelaySeconds: 0
398+
periodSeconds: 10
399+
timeoutSeconds: 5
400+
failureThreshold: 60
401+
successThreshold: 1
402+
403+
# Registry health probes
404+
registry:
405+
livenessProbe:
406+
enabled: true
407+
initialDelaySeconds: 5
408+
periodSeconds: 5
409+
timeoutSeconds: 5
410+
failureThreshold: 5
411+
successThreshold: 1
412+
readinessProbe:
413+
enabled: true
414+
initialDelaySeconds: 5
415+
periodSeconds: 5
416+
timeoutSeconds: 1
417+
failureThreshold: 5
418+
successThreshold: 1
419+
startupProbe:
420+
enabled: false
421+
initialDelaySeconds: 0
422+
periodSeconds: 10
423+
timeoutSeconds: 5
424+
failureThreshold: 60
425+
successThreshold: 1
426+
```
427+
326428
### Prometheus Integration
327429
328430
ServiceMonitors are available for webapp and supervisor services:

hosting/k8s/helm/templates/electric.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,39 @@ spec:
4646
{{- with .Values.electric.extraEnvVars }}
4747
{{- toYaml . | nindent 12 }}
4848
{{- end }}
49+
{{- if .Values.electric.livenessProbe.enabled }}
4950
livenessProbe:
5051
httpGet:
5152
path: /v1/health
5253
port: http
53-
initialDelaySeconds: 10
54-
periodSeconds: 10
55-
timeoutSeconds: 5
56-
failureThreshold: 5
54+
initialDelaySeconds: {{ .Values.electric.livenessProbe.initialDelaySeconds }}
55+
periodSeconds: {{ .Values.electric.livenessProbe.periodSeconds }}
56+
timeoutSeconds: {{ .Values.electric.livenessProbe.timeoutSeconds }}
57+
failureThreshold: {{ .Values.electric.livenessProbe.failureThreshold }}
58+
successThreshold: {{ .Values.electric.livenessProbe.successThreshold }}
59+
{{- end }}
60+
{{- if .Values.electric.readinessProbe.enabled }}
5761
readinessProbe:
5862
httpGet:
5963
path: /v1/health
6064
port: http
61-
initialDelaySeconds: 10
62-
periodSeconds: 10
63-
timeoutSeconds: 5
64-
failureThreshold: 5
65+
initialDelaySeconds: {{ .Values.electric.readinessProbe.initialDelaySeconds }}
66+
periodSeconds: {{ .Values.electric.readinessProbe.periodSeconds }}
67+
timeoutSeconds: {{ .Values.electric.readinessProbe.timeoutSeconds }}
68+
failureThreshold: {{ .Values.electric.readinessProbe.failureThreshold }}
69+
successThreshold: {{ .Values.electric.readinessProbe.successThreshold }}
70+
{{- end }}
71+
{{- if .Values.electric.startupProbe.enabled }}
72+
startupProbe:
73+
httpGet:
74+
path: /v1/health
75+
port: http
76+
initialDelaySeconds: {{ .Values.electric.startupProbe.initialDelaySeconds }}
77+
periodSeconds: {{ .Values.electric.startupProbe.periodSeconds }}
78+
timeoutSeconds: {{ .Values.electric.startupProbe.timeoutSeconds }}
79+
failureThreshold: {{ .Values.electric.startupProbe.failureThreshold }}
80+
successThreshold: {{ .Values.electric.startupProbe.successThreshold }}
81+
{{- end }}
6582
resources:
6683
{{- toYaml .Values.electric.resources | nindent 12 }}
6784
---

hosting/k8s/helm/templates/registry.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,39 @@ spec:
5151
{{- toYaml . | nindent 12 }}
5252
{{- end }}
5353
{{- end }}
54+
{{- if .Values.registry.livenessProbe.enabled }}
5455
livenessProbe:
5556
httpGet:
5657
path: /
5758
port: http
58-
initialDelaySeconds: 10
59-
periodSeconds: 10
60-
timeoutSeconds: 5
61-
failureThreshold: 5
59+
initialDelaySeconds: {{ .Values.registry.livenessProbe.initialDelaySeconds }}
60+
periodSeconds: {{ .Values.registry.livenessProbe.periodSeconds }}
61+
timeoutSeconds: {{ .Values.registry.livenessProbe.timeoutSeconds }}
62+
failureThreshold: {{ .Values.registry.livenessProbe.failureThreshold }}
63+
successThreshold: {{ .Values.registry.livenessProbe.successThreshold }}
64+
{{- end }}
65+
{{- if .Values.registry.readinessProbe.enabled }}
6266
readinessProbe:
6367
httpGet:
6468
path: /
6569
port: http
66-
initialDelaySeconds: 10
67-
periodSeconds: 10
68-
timeoutSeconds: 5
69-
failureThreshold: 5
70+
initialDelaySeconds: {{ .Values.registry.readinessProbe.initialDelaySeconds }}
71+
periodSeconds: {{ .Values.registry.readinessProbe.periodSeconds }}
72+
timeoutSeconds: {{ .Values.registry.readinessProbe.timeoutSeconds }}
73+
failureThreshold: {{ .Values.registry.readinessProbe.failureThreshold }}
74+
successThreshold: {{ .Values.registry.readinessProbe.successThreshold }}
75+
{{- end }}
76+
{{- if .Values.registry.startupProbe.enabled }}
77+
startupProbe:
78+
httpGet:
79+
path: /
80+
port: http
81+
initialDelaySeconds: {{ .Values.registry.startupProbe.initialDelaySeconds }}
82+
periodSeconds: {{ .Values.registry.startupProbe.periodSeconds }}
83+
timeoutSeconds: {{ .Values.registry.startupProbe.timeoutSeconds }}
84+
failureThreshold: {{ .Values.registry.startupProbe.failureThreshold }}
85+
successThreshold: {{ .Values.registry.startupProbe.successThreshold }}
86+
{{- end }}
7087
resources:
7188
{{- toYaml .Values.registry.resources | nindent 12 }}
7289
volumeMounts:

hosting/k8s/helm/templates/supervisor.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,39 @@ spec:
9595
- name: metrics
9696
containerPort: {{ .Values.supervisor.service.ports.metrics }}
9797
protocol: TCP
98+
{{- if .Values.supervisor.livenessProbe.enabled }}
9899
livenessProbe:
99100
httpGet:
100101
path: /health
101102
port: workload
102-
initialDelaySeconds: 30
103-
periodSeconds: 10
104-
timeoutSeconds: 5
105-
failureThreshold: 3
103+
initialDelaySeconds: {{ .Values.supervisor.livenessProbe.initialDelaySeconds }}
104+
periodSeconds: {{ .Values.supervisor.livenessProbe.periodSeconds }}
105+
timeoutSeconds: {{ .Values.supervisor.livenessProbe.timeoutSeconds }}
106+
failureThreshold: {{ .Values.supervisor.livenessProbe.failureThreshold }}
107+
successThreshold: {{ .Values.supervisor.livenessProbe.successThreshold }}
108+
{{- end }}
109+
{{- if .Values.supervisor.readinessProbe.enabled }}
106110
readinessProbe:
107111
httpGet:
108112
path: /health
109113
port: workload
110-
initialDelaySeconds: 15
111-
periodSeconds: 10
112-
timeoutSeconds: 5
113-
failureThreshold: 3
114+
initialDelaySeconds: {{ .Values.supervisor.readinessProbe.initialDelaySeconds }}
115+
periodSeconds: {{ .Values.supervisor.readinessProbe.periodSeconds }}
116+
timeoutSeconds: {{ .Values.supervisor.readinessProbe.timeoutSeconds }}
117+
failureThreshold: {{ .Values.supervisor.readinessProbe.failureThreshold }}
118+
successThreshold: {{ .Values.supervisor.readinessProbe.successThreshold }}
119+
{{- end }}
120+
{{- if .Values.supervisor.startupProbe.enabled }}
121+
startupProbe:
122+
httpGet:
123+
path: /health
124+
port: workload
125+
initialDelaySeconds: {{ .Values.supervisor.startupProbe.initialDelaySeconds }}
126+
periodSeconds: {{ .Values.supervisor.startupProbe.periodSeconds }}
127+
timeoutSeconds: {{ .Values.supervisor.startupProbe.timeoutSeconds }}
128+
failureThreshold: {{ .Values.supervisor.startupProbe.failureThreshold }}
129+
successThreshold: {{ .Values.supervisor.startupProbe.successThreshold }}
130+
{{- end }}
114131
resources:
115132
{{- toYaml .Values.supervisor.resources | nindent 12 }}
116133
env:

hosting/k8s/helm/templates/webapp.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,39 @@ spec:
4949
- name: http
5050
containerPort: {{ .Values.webapp.service.targetPort }}
5151
protocol: TCP
52+
{{- if .Values.webapp.livenessProbe.enabled }}
5253
livenessProbe:
5354
httpGet:
5455
path: /healthcheck
5556
port: http
56-
initialDelaySeconds: 10
57-
periodSeconds: 30
58-
timeoutSeconds: 10
59-
failureThreshold: 5
57+
initialDelaySeconds: {{ .Values.webapp.livenessProbe.initialDelaySeconds }}
58+
periodSeconds: {{ .Values.webapp.livenessProbe.periodSeconds }}
59+
timeoutSeconds: {{ .Values.webapp.livenessProbe.timeoutSeconds }}
60+
failureThreshold: {{ .Values.webapp.livenessProbe.failureThreshold }}
61+
successThreshold: {{ .Values.webapp.livenessProbe.successThreshold }}
62+
{{- end }}
63+
{{- if .Values.webapp.readinessProbe.enabled }}
6064
readinessProbe:
6165
httpGet:
6266
path: /healthcheck
6367
port: http
64-
initialDelaySeconds: 10
65-
periodSeconds: 30
66-
timeoutSeconds: 10
67-
failureThreshold: 5
68+
initialDelaySeconds: {{ .Values.webapp.readinessProbe.initialDelaySeconds }}
69+
periodSeconds: {{ .Values.webapp.readinessProbe.periodSeconds }}
70+
timeoutSeconds: {{ .Values.webapp.readinessProbe.timeoutSeconds }}
71+
failureThreshold: {{ .Values.webapp.readinessProbe.failureThreshold }}
72+
successThreshold: {{ .Values.webapp.readinessProbe.successThreshold }}
73+
{{- end }}
74+
{{- if .Values.webapp.startupProbe.enabled }}
75+
startupProbe:
76+
httpGet:
77+
path: /healthcheck
78+
port: http
79+
initialDelaySeconds: {{ .Values.webapp.startupProbe.initialDelaySeconds }}
80+
periodSeconds: {{ .Values.webapp.startupProbe.periodSeconds }}
81+
timeoutSeconds: {{ .Values.webapp.startupProbe.timeoutSeconds }}
82+
failureThreshold: {{ .Values.webapp.startupProbe.failureThreshold }}
83+
successThreshold: {{ .Values.webapp.startupProbe.successThreshold }}
84+
{{- end }}
6885
resources:
6986
{{- toYaml .Values.webapp.resources | nindent 12 }}
7087
env:

0 commit comments

Comments
 (0)