How do I change the passwords for mysql after the helm chart from bitnami has been used?

11/8/2021

I deployed mysql using this command:

helm install --namespace ns-mysql project-mysql --version 8.8.8

In the future, when I'll need to change the three passwords: mysql-password, mysql-replication-password and mysql-root-password, is there a standard way to do that with helm?

NOTES:

  • The passwords have been saved into the secrets of EKS
-- Mario Stefanutti
bitnami
kubernetes
kubernetes-helm

1 Answer

11/8/2021

You need to use the ordinary MySQL commands to change the passwords. Running helm update with the changed passwords isn't a bad idea (especially if you have other components that are getting the password from the same Secret) but it can't on its own actually change the password.

The problem here is that the password is stored inside the MySQL data. Kubernetes knows that data is in a PersistentVolumeClaim, but it doesn't have a way to read or modify the data, and you can't directly change the password at the filesystem level. Even if that was possible, Kubernetes API calls also can't directly access the PVC contents. That means Kubernetes has no way to change the password, and Helm can't do anything Kubernetes can't do.

-- David Maze
Source: StackOverflow