Repository navigation
[grafana] Document that the admin password is only applied on first start - #896
Merged
jkroepke merged 1 commit intoOct 16, 2026
Conversation
…tart Grafana reads GF_SECURITY_ADMIN_PASSWORD only when it creates the admin user. With a persistent database, changing adminPassword or the existing Secret leaves the stored password unchanged, and the sidecars, which authenticate with the Secret, start getting 401 on reload calls. With renderers that cannot use lookup (Argo CD), the generated password also changes on every render. Describe this in the README and show how to rotate the password. Signed-off-by: YoungjuKim <[email protected]>
Member
|
Thanks! |
jkroepke
approved these changes
Oct 16, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
The README does not say what happens when
adminPasswordor the password inadmin.existingSecretis changed after the first install. Grafana readsGF_SECURITY_ADMIN_PASSWORDonly when it creates the admin user ("Set once on first-run", configuration reference). With a persistent database, ahelm upgraderestarts the pod with the new value and Grafana keeps the old password. This has been reported many times in the old repository (grafana#152, grafana#3568, grafana#3790), and the README in this repository still does not mention it.This PR adds an "Admin user and password" section that covers:
REQ_USERNAME/REQ_PASSWORDintemplates/_pod.tpl), so they get401once the Secret and the database disagree;grafana.passwordintemplates/_helpers.tpl) relies onlookup. Renderers that usehelm template, such as Argo CD, get a new random value on every render;Chart version bumped to 14.0.1 (docs only).
How I verified it
GF_SECURITY_ADMIN_PASSWORD=pw-one:GET /api/userwithpw-onereturns 200,pw-tworeturns 401;GF_SECURITY_ADMIN_PASSWORD=pw-two:pw-onestill returns 200 andpw-tworeturns 401;printf 'pw-two\n' | grafana cli --config <ini> admin reset-admin-password --password-from-stdin(the command shown in the README):pw-onereturns 401 andpw-tworeturns 200.helm template(Helm v3.18.2) of this chart run twice withoutadminPasswordrenders two differentadmin-passwordvalues intemplates/secret.yaml. With--set adminPassword=xthe value stays the same.13.2.4-distrolessimage (the chart's default) has/usr/share/grafana/binonPATH, sografana cliworks throughkubectl execwithout a shell. The chart also setsGF_PATHS_DATA, so the CLI opens the same database as the server.helm lint charts/grafanapasses.Which issue this PR fixes
Special notes for your reviewer
This changes documentation only, so I did not add a helm-unittest case.
Checklist
[grafana])This change was drafted with AI assistance and reviewed by me.
🤖 Generated with Claude Code