[stable/grafana] Login defined in .values.admin.existingSecret is invalid
Describe the bug
When setting admin username and password via .admin.existingSecret in values.yaml, the defined login is not working when trying to log into the Grafana web UI with the defined credentials.
Version of Helm and Kubernetes Helm: 3.1.0 Kubernetes: 1.17.3
Which chart stable/grafana Chart version: 5.0.3
What happened After configuring the following secret
apiVersion: v1
kind: Secret
metadata:
name: grafana
namespace: grafana
type: Opaque
data:
adminUser: YWRtaW4K #admin
adminPassword: <REDACTED>
and applying it to the cluster and then configuring the following section in the charts values.yaml
# Administrator credentials when not using an existing secret (see below)
adminUser: admin
# adminPassword: password
# Use an existing secret for the admin user.
admin:
existingSecret: grafana
userKey: adminUser
passwordKey: adminPassword
and deploying the chart, login with the credentials defined in the secret fails with an Invalid username or password exception.
What you expected to happen Login with the credentials defined in the secrets succeeds.
Anything else we need to know?
Both values for userKey and passwordKey have been base64 encoded via echo 'admin' | base64 -w 0 and have then been included in the secret.
Multiple passwords with and without special characters have been tried without a change in behavior, same for the username.
Name of the secret has been changed without change in behavior.
When kubectl exec -ti <pod-name> -c grafana sh followed by running env, both GF_SECURITY_ADMIN_USER and GF_SECURITY_ADMIN_PASSWORD are set to the correct values defined in the secret, yet login doesn't work.
When not using a secret to configure the admin login, but configuring
# Administrator credentials when not using an existing secret (see below)
adminUser: admin
adminPassword: password
in values.yaml, login to Grafana succeeds with the defined login.
Bumping this, I tried overriding the admin password with the default grafana chart values for using a secret and get "Pod errors: CreateContainerConfigError"
grafana:
adminPassword: null
admin:
existingSecret: grafana-admin-secret
passwordKey: admin-secret
Yeah, also just run into this - defined a secret, set the values, reinstalled Grafana after a helm delete --purge grafana and can't log in.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.
This issue is being automatically closed due to inactivity.
I just run into this issue as well does someone has a solution?
I figure out what I have been doing wrong. Instead off using data I used stringData: apiVersion: v1 kind: Secret metadata: name: grafana-secret type: Opaque stringData: admin-user: admin admin-password: admin
so if someone encounters it I hope this post will help you
I figure out what I have been doing wrong. Instead off using data I used stringData: apiVersion: v1 kind: Secret metadata: name: grafana-secret type: Opaque stringData: admin-user: admin admin-password: admin
so if someone encounters it I hope this post will help you
These recently resolve the issue for me as well. I validated the environment variable in the running pod was correct, so not sure why the change from data -> stringData changes behavior