Cannot login to grafana kubernetes

grafana will store the password in the database on the first execution only so if you are reusing the persistent volume, the password won’t change even if you change the secret (GF_SECURITY_ADMIN_PASSWORD enviroment variable).

In order to reset the password you need to use grafana-cli on the container running grafana:

kubectl exec -ti -n grafana <pod> /bin/bash # get a shell to the pod / container running grafana
bash-5.0$ grafana-cli admin reset-admin-password $GF_SECURITY_ADMIN_PASSWORD
INFO[09-02|20:25:36] Connecting to DB                         logger=sqlstore dbtype=sqlite3
INFO[09-02|20:25:36] Starting DB migration                    logger=migrator
4 Likes