bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.04k stars 9.22k forks source link

Support passing POSTGRES_INITSCRIPTS_PASSWORD from k8s secret #30469

Open james64 opened 1 week ago

james64 commented 1 week ago

Name and Version

bitnami/postgres:latest

What is the problem this feature will solve?

This is the list of environment variables passed to the primary statefulset which contains passwords:

All of these have the value passed in via valueFrom.secretKeyRef as it should be. All of them except POSTGRES_INITSCRIPTS_PASSWORD which is passed by value directly in sts yaml definition.

What is the feature you are proposing to solve the problem?

Add support for passing passwords directly or as a pre-existing secret. When passed directly add it to some secret and reference it in sts yaml using valueFrom.secretKeyRef. Standard stuff which already works for the rest of pg_pswd env vars.

What alternatives have you considered?

It is possible to pass the password as part of primary.extraEnvVarsSecret. But that still means that primary.initdb.password should be updated as suggested above or removed as not useful.

carrodher commented 3 days ago

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.