From 205271334400f691697f3a55c7f438ee353278f4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste REVEL Date: Tue, 10 Jun 2025 16:29:07 +0200 Subject: [PATCH] feat: add basic helm healthcheck config --- src/templates/deployment.yaml | 10 ++++++---- src/values.yaml | 12 ++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/templates/deployment.yaml b/src/templates/deployment.yaml index 16d147d..91753f4 100644 --- a/src/templates/deployment.yaml +++ b/src/templates/deployment.yaml @@ -45,13 +45,15 @@ spec: env: - name: EULA value: {{ .Values.eula | squote }} + {{- with .Values.healthcheck }} livenessProbe: exec: command: ["mc-monitor", "status"] - periodSeconds: 1 - failureThreshold: 5 # 5 seconds before considering the pod as unhealthy + periodSeconds: {{ .checkInterval }} + failureThreshold: {{ div .failureThreshold.liveness .checkInterval }} startupProbe: exec: command: ["mc-monitor", "status"] - periodSeconds: 1 - failureThreshold: 60 # 1 minute before considering the startup as failed + periodSeconds: {{ .checkInterval }} + failureThreshold: {{ div .failureThreshold.startup .checkInterval }} + {{- end }} diff --git a/src/values.yaml b/src/values.yaml index a76c590..e16f514 100644 --- a/src/values.yaml +++ b/src/values.yaml @@ -17,3 +17,15 @@ container: service: ports: nodePort: 30000 + +# Health checks configuration. +# If the server is deemed "unhealthy", it will be automatically restarted +# to ensure high availability and minimize downtime. +healthcheck: + # Time interval (in seconds) between consecutive health checks. + checkInterval: 1 + # Time in seconds before the server is considered unhealthy. + # Must be a multiple of checkInterval. + failureThreshold: + startup: 60 # During startup phase. + liveness: 5 # During normal operation.