-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle sensitive values in chart 7.1.0? #2896
Comments
I think this is related to #2899. |
Also hit this and don't know how to proceed (except by setting
I tried changing this to:
But still get the same error.
Maybe |
I believe the solution (also the best practice (?) for passing sensitive values to grafana.ini) is to override configuration with environment variables. For example, replace:
with
and
|
Thanks.
And remove the That way the helm chart creates the secret for me. The relevant parts of the helm diff:
|
as mentioned here i am facing the same issue, but only within the CI/CD run. according to the Grafana Helm Documentation the secrets should be passed via the |
I got it working. This is the diff from the chart values file:
|
Maybe I'm missing something but I wouldn't expect:
to fail validation. I've created a Secret with the |
I have a very similar issue when trying to define the username and password for the SMTP server configuration.
Within the Grafana POD:
It does work find when I manually specify the Username and Password, but this not the way I would prefer to work. |
FWIW -- you can use the following syntax for files in environment variable configs: This is documented here: https://github.com/grafana/grafana/blob/48a5c1e8509980b6ffe8cf5c5e486d096eb7058c/packaging/docker/run.sh#L49-L61 I have a PR (#2904) open to fix the issue with "secrets" in the |
Thanks @bdalpe , I tried your suggestion and it works beautifully.
|
This is fixed with chart version 7.2.2. |
In my case, I configured Grafana v10.3.1 using the variable expansion feature as the error message advised.
TLDR
Google OAuth integration with grafana using variable expensionProblemIf the
This error message is triggered by a conditional statement declared in the
Environment
How to setupCreate a new secret resource containing Google OAuth client id and secret.
Add
Install(or upgrade) kube-prometheus-stack release on your EKS cluster.
The Google OAuth ID and Secret are injected into the Pod as environment variables. These environment variables are taken from the kubernetes secret we created in the previous step.
|
This is a workaround while we are implementing a better architecture for managing secrets in the DevOps Stack. One that milestone is accomplished, we will better manage the way we pass these values. See: - https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#override-configuration-with-environment-variables - grafana/helm-charts#2896
This is a workaround while we are implementing a better architecture for managing secrets in the DevOps Stack. One that milestone is accomplished, we will better manage the way we pass these values. See: - https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#override-configuration-with-environment-variables - grafana/helm-charts#2896
Is someone able to do something similar for LDAP? It seems bind_password of ldap needs to be in ldap.toml file and we define this file in grafana.ini. I am not able to substitute values ldap.toml. Is there a way to pass a variable in grafana.ini which can be used in ldap.toml? |
@prashant0085 environment variables are supported in TOML according to the Grafana docs: https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/ldap/#using-environment-variables
Then set in your Helm values:
I haven't tested this, but in theory it should work. |
@bdalpe Thanks for quick response. I have tried both the below syntax in ldap.toml as per Grafana documentation on this page: https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/ldap/#using-environment-variables
Also I have the bind password as kubernetes secret, which I am converting to env variable by setting I have checked and confirmed that password is available as env variable in grafana pod. Sharing echo command output below:
values.yaml below
Instead of actual value ldap.toml is getting populated with actual variable name which I defined in values.yaml starting with $ and when I hard code the password manually in
|
@prashant0085 You're mixing Would also recommend replacing the single quotes with double quotes. |
@bdalpe I took the code from example, but in my values.yaml I have always used
UPDATE: tested and it doesn't work, I am using kube-proemtheus-stack helm chart 58.6.1 |
I'm also unable to get the variables in grafana.ini to work. |
@younsl solution worked for me with |
We tried upgrading to the latest helm chart v7.1.0.
In the changelog it mentions failing if you have sensitive secrets in your values file. Currently, we do (auth.azuread).
The readme hasn't been updated, so currently It's not clear to us how to proceed.
Any documention for this?
The text was updated successfully, but these errors were encountered: