Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 279
Vincent J Avatar asked Jan 21 '20 10:01

Vincent J


2 Answers

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 ✔
like image 127
Vincent J Avatar answered Sep 19 '22 12:09

Vincent J


Okay, try this.

kubectl get pod -n monitoring

kubectl exec -it grafana-00000000aa-lpwkk -n monitoring -- sh

grafana-cli admin reset-admin-password NEWPASSWORD

like image 33
user5866501 Avatar answered Sep 16 '22 12:09

user5866501