Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/postgresql] postgres user logins fails after uninstall / install cycle #19867

Closed
jdayllon opened this issue Jan 5, 2020 · 2 comments
Closed

Comments

@jdayllon
Copy link

jdayllon commented Jan 5, 2020

Describe the bug

Example commands (and any other) fails using "postgres" user after cycle like that:

  • Install a chart with a name, i.e. : my-postgres : helm install my-postgres stable/postgresql
  • Uninstall it : helm uninstall my-postgres
  • Reinstall with the same name: helm install my-postgres stable/postgresql

And then if you try any example commands will output:
psql: FATAL: password authentication failed for user "postgres"

Version of Helm and Kubernetes:

Helm v3.0.2
Kubernetes 1.14.8 (Docker for Mac distro)

Which chart:
stable/postgresql-8.1.2

What happened:
After a reinstall i can't login postgres user console outs:
password authentication failed for user

What you expected to happen:
Correct login.

How to reproduce it (as minimally and precisely as possible):
Install, uninstall and reinstall with the same name. If other name is used no problems found.

Anything else we need to know:
N/A

@sameersbn
Copy link
Contributor

sameersbn commented Jan 7, 2020

@jdayllon the stable/postgresql chart deploys statefulsets for the master and slave pods with persistence enabled by default. When the chart is uninstalled, the statefulset by nature does not remove the PVC's that were attached to the master/slave pods. When you install the chart again with the same name, k8s sees that an PVC's already exist and attached them instead of creating new PVC's. As a result the new deployment will have the same data from the previous installation which means that the passwords will be the same as the previous installation.

If you want a fresh install you either remove the existing pvc's or install the chart with a different name

@jdayllon
Copy link
Author

jdayllon commented Jan 7, 2020

@sameersbn thanks! i'm quite new on helm.

@jdayllon jdayllon closed this as completed Jan 7, 2020
iknowhtml added a commit to iknowhtml/todo that referenced this issue Jan 9, 2020
This script is necessary to ensure
that the development release is removed
and to delete residual PVCs
as those are not deleted upon deletion of the Postgres StatefulSets
that attach to them.
See: helm/charts#19867)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants