Reinstalling kong with name previously used fails to start

i’m trying to script a kong install, and use the same helm release name each time. the first time everything come up just fine. subsequent attempts result in the init pod failing to authenticate with the postgres pod. when i delete the helm release i am purging. What am i missing?

helm install stable/kong --name wondering-gorilla --set ingressController.enabled=true
NAMESPACE     NAME                                                 READY     STATUS             RESTARTS   AGE
default       wondering-gorilla-kong-6598f4558f-xhgz8              0/1       Init:0/1           0          36s
default       wondering-gorilla-kong-controller-75bf56df4b-kckp7   0/2       Init:0/1           0          36s
default       wondering-gorilla-kong-init-migrations-58vlx         0/1       CrashLoopBackOff   1          36s
default       wondering-gorilla-postgresql-0                       1/1       Running            0          36s
$ k logs wondering-gorilla-kong-init-migrations-58vlx

Error: [PostgreSQL error] failed to retrieve server_version_num: FATAL: password authentication failed for user "kong"
helm delete wondering-gorilla --purge

Running a helm delete --purge won’t delete the Persistent Volume that is created for the Postgres Pod.
This results in a new password being set in Kong’s deployment and an outdated password in the Postgres Pod.

You will need to manually delete it using kubectl delete pvc data-wondering-gorilla-postgresql-0. Once you do that, a fresh deployment will work.

Another solution around it will be to hardcode a password or provide that as a secret to the Postgres sub-chart.

1 Like