summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-08 14:23:14 +0200
committerPaul Buetow <paul@buetow.org>2026-02-08 14:23:14 +0200
commit62278591de0650ccea63d219b495140c6924ae00 (patch)
tree1ecdf7372e0e7591a56e1a72046174b8e2284017
parent190473b0dcb41ef49f1e4e3dd7a1e8fa4150181d (diff)
Add PostgreSQL health checks to fix immich pod restarts
Added liveness and readiness probes to the PostgreSQL deployment to ensure it's ready to accept connections before immich-server attempts to connect. This fixes the race condition causing ECONNREFUSED errors and pod restarts. The readiness probe prevents services from routing traffic until PostgreSQL is fully initialized, while the liveness probe ensures the container is restarted if PostgreSQL becomes unresponsive.
-rw-r--r--f3s/immich/helm-chart/templates/postgres.yaml20
1 files changed, 20 insertions, 0 deletions
diff --git a/f3s/immich/helm-chart/templates/postgres.yaml b/f3s/immich/helm-chart/templates/postgres.yaml
index 0064dcd..2b49767 100644
--- a/f3s/immich/helm-chart/templates/postgres.yaml
+++ b/f3s/immich/helm-chart/templates/postgres.yaml
@@ -30,6 +30,26 @@ spec:
secretKeyRef:
name: immich-db-secret
key: password
+ livenessProbe:
+ exec:
+ command:
+ - /bin/sh
+ - -c
+ - pg_isready -U immich -d immich
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 3
+ readinessProbe:
+ exec:
+ command:
+ - /bin/sh
+ - -c
+ - pg_isready -U immich -d immich
+ initialDelaySeconds: 10
+ periodSeconds: 5
+ timeoutSeconds: 3
+ failureThreshold: 3
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data