Upgrading to chart version 4.4.3 with embedded psql (11.9.0) doesn't work
Summary
postgresql pod doesn't start (CrashLoopBackOff)
Steps to reproduce
Upgrade from 4.0.12 to 4.4.3 chart (postgresql got updated from 11.7.0 to 11.9.0)
Configuration used
Default chart config
Current behavior
CrashLoopBackOff for postgresql pod.
Expected behavior
postgresql should be start without any error.
Versions
- Chart: 4.4.3
- Platform:
- Cloud: GKE
- Self-hosted: GCP
- Kubernetes: (
kubectl version v1.17.9-gke.1504
)- Client:v1.16.13
- Server: v1.17.9-gke.1504
- Helm: (
helm version
)- Client: v3.3.4
- Server:
Seems that in PSQL 11.9 docker image there is a NEW script modifing env variables: cat /opt/bitnami/scripts/postgresql-env.sh
env variables with suffix _FILE got suppressed so
PGPASSWORD=$(cat ${POSTGRES_POSTGRES_PASSWORD_FILE}) psql -d gitlabhq_production -U postgres -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm; CREATE EXTENSION IF NOT EXISTS btree_gist;
script does not work.
env variable POSTGRES_POSTGRES_PASSWORD is existing (got populated with /opt/bitnami/scripts/postgresql-env.sh)
postgresql 14:59:04.63 INFO ==> ** Starting PostgreSQL setup **
postgresql 14:59:04.65 INFO ==> Validating settings in POSTGRESQL_* env vars..
postgresql 14:59:04.66 INFO ==> Loading custom pre-init scripts...
postgresql 14:59:04.66 INFO ==> Loading user's custom files from /docker-entrypoint-preinitdb.d ...
postgresql 14:59:04.67 INFO ==> Initializing PostgreSQL database...
postgresql 14:59:04.69 INFO ==> pg_hba.conf file not detected. Generating it...
postgresql 14:59:04.69 INFO ==> Generating local authentication configuration
postgresql 14:59:04.70 INFO ==> Deploying PostgreSQL with persisted data...
postgresql 14:59:04.71 INFO ==> Configuring replication parameters
postgresql 14:59:04.74 INFO ==> Configuring fsync
postgresql 14:59:04.77 INFO ==> Loading custom scripts...
postgresql 14:59:04.77 INFO ==> Loading user's custom files from /docker-entrypoint-initdb.d ...
postgresql 14:59:04.77 INFO ==> Starting PostgreSQL in background...
/docker-entrypoint-initdb.d/..2020_10_12_14_57_17.584979246/enable_extensions.sh: line 5: POSTGRES_POSTGRES_PASSWORD_FILE: unbound variable
Password for user postgres:
psql: FATAL: password authentication failed for user "postgres"
postgresql 14:59:04.91 INFO ==> Stopping PostgreSQL...
This issue seems relative to a core change inside docker docker.io/bitnami/postgresql 11.9.0 image
this script modifying env variable is not present inside docker.io/bitnami/postgresql 11.7.0 image
Edited by Clément Schockaert