I need a user with priveleges to create new databases in a fresh new installed cluster.
I use postgres
user that supposed to be created by Percona operator. Operator version is 1.1.0
helm install postgresql percona/pg-db --namespace postgre --version "1.1.0"
export POSTGRES_PASSWORD=$(kubectl -n postgre get secrets postgresql-pg-db-postgres-secret -o jsonpath="{.data.password}" | base64 --decode)
export POSTGRES_USER=$(kubectl -n postgre get secrets postgresql-pg-db-postgres-secret -o jsonpath="{.data.username}" | base64 --decode)
kubectl run -i --rm --tty percona-client --image=perconalab/percona-distribution-postgresql:13.2 --restart=Never \
-- psql "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql-pg-db-pgbouncer.postgre.svc.cluster.local/pgdb"
psql: error: FATAL: no such user
pod "percona-client" deleted
pod default/percona-client terminated (Error)
The secret for postgres
user and password is created, but PostgreSQL server has no such user.
Why? How to fix?
Server has only pguser
defined, but this one has no permission to create a new database.