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

bitnami/postgres & persistent storage class #629

Closed
pmpetit opened this issue Apr 22, 2023 · 1 comment
Closed

bitnami/postgres & persistent storage class #629

pmpetit opened this issue Apr 22, 2023 · 1 comment

Comments

@pmpetit
Copy link
Contributor

pmpetit commented Apr 22, 2023

Description

the bitnami postresql (that hold pgwatch2_metrics) instance uses a persistent storage class.

So the first time you create the helm, there is no problem.

helm install pgwatch2 .

if you check, you can see that a pvc 'data-pgwatch2-postgresql-0' is created

kubectl get pvc
NAME                         STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
data-pgwatch2-postgresql-0   Bound    pvc-67f4dfca-ad54-4ed3-aa8a-482e3f4c8e50   8Gi        RWO            standard-rwo   31m

then remove the component:

helm delete pgwatch2

re-check the pvc

kubectl get pvc
NAME                         STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
data-pgwatch2-postgresql-0   Bound    pvc-67f4dfca-ad54-4ed3-aa8a-482e3f4c8e50   8Gi        RWO            standard-rwo   31m

as you can see, it is still there.

now, try to recreate the helm

helm install pgwatch2 .

you will see that pgwatch2 can't be created

pgwatch2-bootstrap1 connection NOT OK. sleeping 1s...

then inside the postgresql pod, try to connect to the db :

I have no name!@pgwatch2-postgresql-0:/$ env |grep PASSWORD
POSTGRES_PASSWORD=MVDjvJRTWB
I have no name!@pgwatch2-postgresql-0:/$ export PGPASSWORD=MVDjvJRTWB
I have no name!@pgwatch2-postgresql-0:/$ psql -U postgres
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  password authentication failed for user "postgres"
I have no name!@pgwatch2-postgresql-0:/$ ls

why :
it is because of the persistent volume. the db has been created with the previous password (of the first run). So it can't connect to the db.

Solution

To solve the problem, you have to drop the pvc

kubectl delete pvc/data-pgwatch2-postgresql-0

and now you can recreate the helm.

I think the pvc should not be persistent.

@pmpetit
Copy link
Contributor Author

pmpetit commented Apr 24, 2023

in fact, it is not due to pgwatch2 but bitnami/postgres helm.

you have to create before the secret "pwatch2_postgresql". So that bitnami/pg will use it . The next time it will re-use this one.

we can close this isuue

@pmpetit pmpetit closed this as completed Apr 24, 2023
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