prole/supabase/helm/prole-supabase/templates/test/db.yaml
chrisfu 133b719479 Align CNPG bootstrap placement with Ansible policy
Prefer infra-managed manifests for bootstrap; reconcile CNPG instances based on Ready+schedulable labeled db nodes; update manifests to use node-role affinity + anti-affinity; add policy/tests and config touch-ups (incl. prole.cfg).
2026-03-18 22:06:41 -07:00

31 lines
905 B
YAML

{{- if .Values.deployment.db.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "supabase.fullname" . }}-test-db
labels:
{{- include "supabase.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
ttlSecondsAfterFinished: 100
template:
spec:
containers:
- command:
- /bin/sh
- -c
- |
pg_isready -h $(DB_HOST) -p $(DB_PORT) -U postgres || $(echo "\e[0;31mFailed to connect to the database." && exit 1)
echo "Database is ready"
env:
- name: DB_HOST
value: {{ include "supabase.database.host" . | quote }}
- name: DB_PORT
value: {{ include "supabase.database.port" . | quote }}
image: postgres:15-alpine
imagePullPolicy: IfNotPresent
name: test-db
restartPolicy: Never
{{- end }}