apiVersion: apps/v1 kind: StatefulSet metadata: name: supabase-db spec: serviceName: db replicas: 1 selector: matchLabels: component: db template: metadata: labels: component: db spec: securityContext: fsGroup: 999 containers: - name: db image: supabase/postgres:17.6.1.136 ports: - containerPort: 5432 env: - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: name: supabase-secrets key: dbPassword - name: POSTGRES_DB value: "{{ .db.name }}" - name: POSTGRES_USER value: "{{ .db.user }}" - name: JWT_SECRET valueFrom: secretKeyRef: name: supabase-secrets key: jwtSecret - name: JWT_EXP value: "{{ .jwtExpiry }}" volumeMounts: - name: supabase-db mountPath: /var/lib/postgresql - name: db-init mountPath: /docker-entrypoint-initdb.d/init-scripts/99-jwt.sql subPath: jwt.sql - name: db-init mountPath: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql subPath: roles.sql - name: db-init mountPath: /docker-entrypoint-initdb.d/migrations/99-realtime.sql subPath: realtime.sql - name: db-init mountPath: /docker-entrypoint-initdb.d/init-scripts/98-webhooks.sql subPath: webhooks.sql livenessProbe: exec: command: - pg_isready - -U - "{{ .db.user }}" - -d - "{{ .db.name }}" initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 6 readinessProbe: exec: command: - pg_isready - -U - "{{ .db.user }}" - -d - "{{ .db.name }}" initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 5 failureThreshold: 3 resources: requests: memory: 256Mi cpu: 100m volumes: - name: supabase-db persistentVolumeClaim: claimName: supabase-db - name: db-init configMap: name: supabase-db-init