Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql db user and password config does't work #16

Open
gongpengjun opened this issue Feb 23, 2022 · 1 comment
Open

postgresql db user and password config does't work #16

gongpengjun opened this issue Feb 23, 2022 · 1 comment

Comments

@gongpengjun
Copy link

postgresqlPassword: B1gB1tBu5 does NOT work as expected.

gongpengjun@mbp kubernetes-automation-toolkit$ vagrant ssh
Last login: Wed Feb 23 14:12:58 2022 from 10.0.2.2
vagrant@ubuntu2004:~$ kubectl get secret --namespace pg pgdb-postgresql -o jsonpath="{.data.postgres-password}" | base64 --decode;echo
P2zJdANSBT

vagrant@ubuntu2004:~$ microk8s kubectl get pods -n pg
NAME                READY   STATUS    RESTARTS   AGE
pgdb-postgresql-0   1/1     Running   0          12h
vagrant@ubuntu2004:~$ microk8s kubectl exec -it pgdb-postgresql-0 -n pg -- bash
I have no name!@pgdb-postgresql-0:/$ env|grep POSTGRES_
POSTGRES_PASSWORD=P2zJdANSBT
I have no name!@pgdb-postgresql-0:/opt/bitnami/postgresql/bin$ psql -U "postgres" -h 127.0.0.1 -p 5432
Password for user postgres: P2zJdANSBT
psql (11.9)
Type "help" for help.

postgres=# \du
                                   List of roles
 Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

vagrant_up.log

@gongpengjun
Copy link
Author

Work around the error by login postgresql and create database and user mannually

postgres=# create database "todo-postgres-db";
postgres=# create user dbuser with encrypted password 'B1gB1tBu5';
postgres=# grant all privileges on database "todo-postgres-db" to dbuser;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant