arrstack: use waitfordb initContainer instead of inline psql loop #386
Reference in New Issue
Block a user
Delete Branch "benvin/arrstack-use-waitfordb"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The sonarr/radarr/prowlarr deployments gated app startup on their Postgres
database being reachable using a hand-written
psql-in-a-shell loop runningthe
postgres:17-alpineimage. Now thatunkin/waitfordbis released(v0.1.0), replace that inline probe with the purpose-built tool so the wait
logic lives in one tested place instead of being copy-pasted per workload.
waitfordbreads the samePG*env as a libpq fallback and exits0onceSELECT 1succeeds under those credentials/database, so the retrofit is adrop-in — the password still never lands in argv.
Changes
wait-for-dbinitContainer image fromdockerhub/library/postgres:17-alpineto
docker-internal/waitfordb:v0.1.0(pinned, notlatest) in all threearrstack deployments.
sh -cpsql loopcommand—waitfordbis the image entrypoint.PGHOST/PGPORT/PGDATABASE/PGUSER/PGPASSWORDenv, thewait-for-dbname, and the resource requests/limits unchanged.WAITFORDB_TIMEOUT=5mso a stuck database fails the pod fast, andWAITFORDB_SSLMODE=disableto match the in-cluster Postgres.Validated with
kubectl kustomize apps/overlays/au-syd1/arrstack(builds clean;3 waitfordb refs, no remaining postgres init image).