AutoDeploy unable to install postgresql extensions
Summary
I've already created an issue at gitlab-org/cluster-integration/auto-deploy-image#55. But I'm unsure if it was the right place as there has been no response from the maintainers. I will copy the body of that issue here
Steps to reproduce
Deploy and app using autodeploy which requires a postgres extension which is included in the bitnami/postgres image. In this case uuid-ossp
and postgis
two extremely popular extensions in postgresql.
What is the current bug behavior?
fails with the Must be super user
message
Jun 15 13:26:18.340 | review-deploy-see-mqc5hb-postgresql-0 | ERROR: permission denied to create extension "uuid-ossp"
Jun 15 13:26:18.340 | review-deploy-see-mqc5hb-postgresql-0 | HINT: Must be superuser to create this extension.
Jun 15 13:26:18.340 | review-deploy-see-mqc5hb-postgresql-0 | STATEMENT: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
Jun 15 13:26:18.341 | review-deploy-see-mqc5hb-postgresql-0 | ERROR: permission denied to create extension "postgis"
Jun 15 13:26:18.341 | review-deploy-see-mqc5hb-postgresql-0 | HINT: Must be superuser to create this extension.
Jun 15 13:26:18.341 | review-deploy-see-mqc5hb-postgresql-0 | STATEMENT: CREATE EXTENSION IF NOT EXISTS "postgis"
I'm not very familiar with Kubernetes, so I don't really know if this is user error, or an issue with the deploy/chart.
Either way i cant find any documentation online for setting this up with autodevops.
What is the expected correct behavior?
This should either succeed or there should be a way to add extensions without the need to set the postgres
user's password in the charts values. Possibly a environment variable to set the extensions needed or to use a superuser, but without the need to have its values in the repository.
My current workaround is to add a .gitlab/auto-deploy-values.yaml
file and these lines to it.
postgresql:
postgresqlDatabase: 'my_app'
postgresqlUsername: 'postgres'
postgresqlPassword: 'my_app'
postgresqlPostgresPassword: 'my_app'
then to set the POSTGRES_USER
, POSTGRES_PASSWORD
and POSTGRES_DB
environment variables in the CI configurations.
The problem is that now the super user password is now in plain text in my repository.
Output of checks
This bug happens on GitLab.com