Skip to content

Commit 75a93b9

Browse files
feat: add basic helm healthcheck config (#8)
1 parent 9543ba0 commit 75a93b9

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/templates/deployment.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ spec:
4545
env:
4646
- name: EULA
4747
value: {{ .Values.eula | squote }}
48+
{{- with .Values.healthcheck }}
4849
livenessProbe:
4950
exec:
5051
command: ["mc-monitor", "status"]
51-
periodSeconds: 1
52-
failureThreshold: 5 # 5 seconds before considering the pod as unhealthy
52+
periodSeconds: {{ .checkInterval }}
53+
failureThreshold: {{ div .failureThreshold.liveness .checkInterval }}
5354
startupProbe:
5455
exec:
5556
command: ["mc-monitor", "status"]
56-
periodSeconds: 1
57-
failureThreshold: 60 # 1 minute before considering the startup as failed
57+
periodSeconds: {{ .checkInterval }}
58+
failureThreshold: {{ div .failureThreshold.startup .checkInterval }}
59+
{{- end }}

src/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ container:
1717
service:
1818
ports:
1919
nodePort: 30000
20+
21+
# Health checks configuration.
22+
# If the server is deemed "unhealthy", it will be automatically restarted
23+
# to ensure high availability and minimize downtime.
24+
healthcheck:
25+
# Time interval (in seconds) between consecutive health checks.
26+
checkInterval: 1
27+
# Time in seconds before the server is considered unhealthy.
28+
# Must be a multiple of checkInterval.
29+
failureThreshold:
30+
startup: 60 # During startup phase.
31+
liveness: 5 # During normal operation.

0 commit comments

Comments
 (0)