charts icon indicating copy to clipboard operation
charts copied to clipboard

Password fails when installing stable/postgresql from subchart

Open zwhitchcox opened this issue 8 years ago • 17 comments

Is this a request for help?: Yes

Version of Helm and Kubernetes: helm 2.10.0 kubernetes: 1.10

Which chart: stable/postgresql

What happened: If I install the chart with helm install --name my-release \ --set postgresUser=my-user,postgresPassword=secretpassword,postgresDatabase=my-database \ stable/postgresql

I can log in with

kubectl run --namespace serfsage my-release-postgresql-client --restart=Never --rm --tty -i --image postgres --env "PGPASSWORD=secretpassword" --command -- psql -U postgres -h my-release-postgresql my-database

However, whenever I try to install it as a subchart, I can't change the password. I try the command

helm upgrade --recreate-pods --install ${RELEASE} ./deploy/chart --namespace ${RELEASE} \ --set pg.pw=mypass \ --set postgresql.postgresUser="postgres" \ --set postgresql.postgresDatabase=staging \ --set persistence.enabled=true \ --set persistence.existingClaim="postgres-data"

But then when I try to connect with

kubectl run --namespace serfsage my-release-postgresql-client --restart=Never --rm --tty -i --image postgres --env "PGPASSWORD=secretpassword" --command -- psql -U postgres -h myproject-postgresql staging

I get the error that it could not authenticate my password.

What you expected to happen: It to accept my password in both cases

How to reproduce it (as minimally and precisely as possible): run the previous listed commands

zwhitchcox avatar Sep 06 '18 18:09 zwhitchcox

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

stale[bot] avatar Oct 06 '18 19:10 stale[bot]

This issue is being automatically closed due to inactivity.

stale[bot] avatar Oct 20 '18 19:10 stale[bot]

Has this been resolved? I'm experiencing the same issue

aweis89 avatar Nov 01 '18 01:11 aweis89

I'm facing this issue with stable version 2.4.0. Environment variable 'POSTGRESQL_PASSWORD' in the container is set to what I had passed from values.yaml file, however I cannot login to postgres cli using this password. Same configuration, works as expected when used as a single chart @zwhitchcox Did you find any workaround for this issue.

nsharma-git avatar Nov 13 '18 09:11 nsharma-git

+1

magnant avatar Nov 22 '18 20:11 magnant

I seem to be running into this issue as well. Any suggestions?

WonderPanda avatar Dec 03 '18 21:12 WonderPanda

Same issue on 2.7.8. and tried it on 1.0.0; same problem. Unfortunately wasted two hours on this issue. It did not occur to me that it would be because of a subchart because the outputs from the templates looked fine. Anyone find anything?

kbambridge avatar Dec 05 '18 14:12 kbambridge

So I'm just having trouble logging in when installing it directly from stable as well. Has anyone else had the same issue?

UPDATE: My issue was related to some stale data in a persistent volume. Removing it from the sub chart fixed the issue for me.

kbambridge avatar Dec 05 '18 14:12 kbambridge

I think I'm having this this issue. Did anyone resolve it?

maxwell-clarke-intranel avatar Dec 13 '18 00:12 maxwell-clarke-intranel

following @k 's advice, deleting the persistentVolumeclaim solved it for me

yuval-k avatar Dec 24 '18 21:12 yuval-k

I am also having the same issue. has anyone solved it

pooranivrv avatar Jan 04 '19 12:01 pooranivrv

What an insanely dumb issue to waste time on! Deleting the PV is obvious when you think about it and if you are experienced with helm. If you are not, you may waste a lot of time... like us :(

AntonOfTheWoods avatar Jan 13 '19 01:01 AntonOfTheWoods

  1. login to pod to change pg_hba.conf. Repace "md5" to trust****. Then
kubectl exec -it ses-db-postgresql-0 bash
sed -i 's/md5/trust' /opt/bitnami/postgresql/data/pg_hba.conf
  1. kill the postgres related processes.
pkill postgres
ps -ef | grep postgres  to ensure all the postgresql processes are killed. 
  1. after kubectl cluster restart the ses-db, now it is able to access postgres.
kubectl port-forward --namespace default svc/xxxx-postgresql 5432:5432 &
psql -h 127.0.0.1 -U postgres

fertiland avatar Jan 23 '19 08:01 fertiland

I'm running into the same issue. Perhaps it's because the values are commented out here? https://github.com/helm/charts/blob/master/stable/postgresql/values.yaml#L80

dan-hu-spring avatar Feb 28 '19 01:02 dan-hu-spring

I had this issue after deleting a helm release then re-deploying with the same name and a new password.

To fix the issue, delete the release and the lingering pvc and re-deploy.

sebnyberg avatar Jul 01 '19 18:07 sebnyberg

@fertiland disabling password authentication does not seem like a proper solution to this issue. (pg_hba.conf docs)

uipo78 avatar Jul 31 '19 17:07 uipo78

We can reset the password for PostgreSQL, documentation of how to do this is already provided by bitnami. I have applied this & it's working perfectly fine.

https://docs.bitnami.com/aws/infrastructure/postgresql/administration/change-reset-password/

rakesh-007 avatar Jul 31 '20 07:07 rakesh-007