Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FIX (helm): Fix probe endpoint

Rostislav Dugin278577a24403
diff --git a/deploy/helm/README.md b/deploy/helm/README.md
index 5f07dab7..25e43380 100644
--- a/deploy/helm/README.md
+++ b/deploy/helm/README.md
@@ -255,10 +255,39 @@ helm install databasus oci://ghcr.io/databasus/charts/databasus \
## Health Checks
-| Parameter | Description | Default Value |
-| ------------------------ | ---------------------- | ------------- |
-| `livenessProbe.enabled` | Enable liveness probe | `true` |
-| `readinessProbe.enabled` | Enable readiness probe | `true` |
+Both probes target `/api/v1/system/version` — a dependency-free endpoint — rather than the deep
+`/api/v1/system/health` monitoring endpoint, so an instance that is degraded but still serving
+traffic is never restarted or pulled out of the Service.
+
+| Parameter | Description | Default Value |
+| ----------------------------------- | ---------------------------------------- | -------------------------- |
+| `livenessProbe.enabled` | Enable liveness probe | `true` |
+| `livenessProbe.httpGet.path` | Liveness request path | `/api/v1/system/version` |
+| `livenessProbe.httpGet.port` | Liveness target port (named or numeric) | `http` |
+| `livenessProbe.initialDelaySeconds` | Delay before the first liveness probe | `30` |
+| `livenessProbe.periodSeconds` | Liveness probe interval | `10` |
+| `livenessProbe.timeoutSeconds` | Liveness probe timeout | `5` |
+| `livenessProbe.failureThreshold` | Failures before the container restarts | `3` |
+| `readinessProbe.enabled` | Enable readiness probe | `true` |
+| `readinessProbe.httpGet.path` | Readiness request path | `/api/v1/system/version` |
+| `readinessProbe.httpGet.port` | Readiness target port (named or numeric) | `http` |
+| `readinessProbe.initialDelaySeconds`| Delay before the first readiness probe | `10` |
+| `readinessProbe.periodSeconds` | Readiness probe interval | `5` |
+| `readinessProbe.timeoutSeconds` | Readiness probe timeout | `3` |
+| `readinessProbe.failureThreshold` | Failures before the pod leaves endpoints | `3` |
+
+Apart from `enabled`, every key is rendered into the Kubernetes probe verbatim, so fields not
+listed above (`successThreshold`, `terminationGracePeriodSeconds`, `tcpSocket`, …) work too.
+
+To swap the handler, null out the default one — Helm merges maps, and a probe carrying two
+handlers is rejected by the API server:
+
+```yaml
+livenessProbe:
+ httpGet: null
+ exec:
+ command: ["databasus", "healthcheck"]
+```
## Custom Storage Size
diff --git a/deploy/helm/templates/statefulset.yaml b/deploy/helm/templates/statefulset.yaml
index b36777ea..35f2c508 100644
--- a/deploy/helm/templates/statefulset.yaml
+++ b/deploy/helm/templates/statefulset.yaml
@@ -91,11 +91,11 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
- {{- toYaml .Values.livenessProbe.probe | nindent 12 }}
- {{- end }}
- {{- if .Values.readinessProbe.enabled }}
+ {{- toYaml (omit .Values.livenessProbe "enabled") | nindent 12 }}
+ {{- end }}
+ {{- if .Values.readinessProbe.enabled }}
readinessProbe:
- {{- toYaml .Values.readinessProbe.probe | nindent 12 }}
+ {{- toYaml (omit .Values.readinessProbe "enabled") | nindent 12 }}
{{- end }}
{{- if or .Values.customRootCA .Values.extraVolumes }}
volumes:
diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml
index 612ebbfe..cb6dffa2 100644
--- a/deploy/helm/values.yaml
+++ b/deploy/helm/values.yaml
@@ -127,30 +127,31 @@ route:
matches: []
timeouts: {}
-# Health checks configuration
+# Health checks configuration.
+# Probes target the dependency-free /system/version rather than the deep
+# /system/health, so a degraded-but-serving instance is never restarted.
+# Every field below is passed to Kubernetes as-is — to swap the handler, null out
+# the default one (`httpGet: null`), since Helm merges maps and a probe carrying
+# two handlers is rejected by the API server.
livenessProbe:
enabled: true
- probe:
- exec:
- command:
- - databasus
- - healthcheck
- initialDelaySeconds: 30
- periodSeconds: 10
- timeoutSeconds: 5
- failureThreshold: 3
+ httpGet:
+ path: /api/v1/system/version
+ port: http
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 3
readinessProbe:
enabled: true
- probe:
- exec:
- command:
- - databasus
- - healthcheck
- initialDelaySeconds: 10
- periodSeconds: 5
- timeoutSeconds: 3
- failureThreshold: 3
+ httpGet:
+ path: /api/v1/system/version
+ port: http
+ initialDelaySeconds: 10
+ periodSeconds: 5
+ timeoutSeconds: 3
+ failureThreshold: 3
# StatefulSet update strategy
updateStrategy: