diff --git a/chart/templates/_initdb_scripts.tpl b/chart/templates/_initdb_scripts.tpl index cb2a456..881a6eb 100644 --- a/chart/templates/_initdb_scripts.tpl +++ b/chart/templates/_initdb_scripts.tpl @@ -5,6 +5,8 @@ #!/bin/bash export PGPASSWORD=$PGPOOL_POSTGRES_PASSWORD +echo "Testing if postgres is running, executing script" + until psql -h {{ include "postgresql-ha.postgresql" $postgresqlEmulatedRoot }} postgres postgres -c '\q'; do >&2 echo "Postgres is unavailable - sleeping" sleep 1