mirror of
https://github.com/dredx/prole.git
synced 2026-09-27 22:04:30 +00:00
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).
31 lines
905 B
YAML
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 }}
|