From 5d1b32d7c6755525fb79c870ca10b5091a9032c2 Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Mon, 2 Feb 2026 19:54:51 +0200 Subject: [PATCH] Fix DB pod --- .../invy-chart/templates/db-statefulset.yaml | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/charts/invy-chart/templates/db-statefulset.yaml b/charts/invy-chart/templates/db-statefulset.yaml index 03b2e4a..e5293e4 100644 --- a/charts/invy-chart/templates/db-statefulset.yaml +++ b/charts/invy-chart/templates/db-statefulset.yaml @@ -72,22 +72,39 @@ spec: mountPath: /docker-entrypoint-initdb.d resources: {{- toYaml .Values.postgres.resources | nindent 12 }} + # Health probes aligned with tasko-chart approach + # Use TCP localhost instead of Unix socket to avoid permission issues + # Fixed shell variable expansion: $POSTGRES_USER not $(POSTGRES_USER) + startupProbe: + exec: + command: + - sh + - -c + - pg_isready -h 127.0.0.1 -p 5432 -U "$POSTGRES_USER" + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 5 + failureThreshold: 30 # Allow up to 150s for slow NFS startup livenessProbe: exec: command: - sh - -c - - pg_isready -U $(POSTGRES_USER) -h /var/run/postgresql + - pg_isready -h 127.0.0.1 -p 5432 -U "$POSTGRES_USER" initialDelaySeconds: 30 periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 readinessProbe: exec: command: - sh - -c - - pg_isready -U $(POSTGRES_USER) -h /var/run/postgresql + - pg_isready -h 127.0.0.1 -p 5432 -U "$POSTGRES_USER" initialDelaySeconds: 5 periodSeconds: 5 + timeoutSeconds: 3 + failureThreshold: 3 volumes: - name: init-script configMap: