Morgan Soren
Morgan Soren

Reputation: 593

PostgreSQL bitnami Helm Chart does not update the user password

When I deploy the Bitnami PostgreSQL Helm Chart (chart version 10.9.4, appVersion: 11.13.0), the passwords for any user are not updated or changed after the first installation.

Lets say that for the first installation I use this command:

helm install postgresql --set postgresqlUsername=rpuser  --set postgresqlPassword=rppass --set 
postgresqlDatabase=reportportal --set postgresqlPostgresPassword=password2 -f 
./reportportal/postgresql/values.yaml ./charts/postgresql

Deleting the Helm release also deletes the stateful set. After that, If I try to install PostgreSQL the same way but with different password values, these won't be updated and will keep the previous ones from the first installation.

Is there something I'm missing regarding where the users' passwords are stored? Do I have to remove the PV and PVC, or do they have nothing to do with this? (I know I can change the passwords using psql commands, but I'm failing to understand why this happens)

Upvotes: 3

Views: 4371

Answers (1)

David Maze
David Maze

Reputation: 159081

The database password and all of the other database data is stored in the Kubernetes PersistentVolume. Helm won't delete the PersistentVolumeClaim by default, so even if you helm uninstall && helm install the chart, it will still use the old database data and the old login credentials.

helm uninstall doesn't have an option to delete the PVC. This matches the standard behavior of a Kubernetes StatefulSet (there is an alpha option to automatically delete the PVC but it needs to be enabled at the cluster level and also requires modifying the StatefulSet object). When you uninstall the chart, you also need to manually delete the PVC:

helm uninstall postgresql
kubectl delete pvc postgresql-primary-data-0
helm install postgresql ... ./charts/postgresql

Upvotes: 3

Related Questions