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.