How to reset grafana's admin password (installed by helm)

1/21/2020

My password once worked, but I don't remember if I changed it or not.

However, I can't reset it.

I tried with no success:

kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo 
> DpveUuOyxNrandompasswordYuB5Fs2cEKKOmG <-- does not work (anymore?)

PS: I did not set any admin email for web-based reset

-- Vincent J
grafana
kubernetes-helm

1 Answer

1/21/2020

Ok found. Best way is to run grafana-cli inside grafana's pod.

kubectl exec --namespace default -it $(kubectl get pods --namespace default -l "app=grafana,release=grafana" -o jsonpath="{.items[0].metadata.name}") grafana-cli admin reset-admin-password yourNewPasswordHere

INFO[01-21|10:24:17] Connecting to DB                         logger=sqlstore dbtype=sqlite3
INFO[01-21|10:24:17] Starting DB migration                    logger=migrator

Admin password changed successfully ✔
-- Vincent J
Source: StackOverflow