Charts: [stable/prometheus-operator] Unable to set grafana.ini smtp settings

Created on 11 Nov 2019  路  6Comments  路  Source: helm/charts

Describe the bug
A clear and concise description of what the bug is.

Version of Helm and Kubernetes:

Client: &version.Version{SemVer:"v2.15.2", GitCommit:"8dce272473e5f2a7bf58ce79bb5c3691db54c96b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.15.2", GitCommit:"8dce272473e5f2a7bf58ce79bb5c3691db54c96b", GitTreeState:"clean"}

Which chart:

prometheus-operator

What happened:

While installing prometheus-operator I'm trying to override the SMTP settings. However, it isn't working. I have a smtp-secret with the following values:

enabled: true
host: smtp.gmail.com:587
user: username
password: pwd

and I have the following in my local values.yaml file:

grafana.ini:
  smtp:
    enabled: true
    host : "smtp.gmail.com:587"
    user : "username" 
    password : "pwd" 

When I install prometheus-operator with the command below:

helm upgrade --install prometheus stable/prometheus-operator 
--set kubeEtcd.enabled=true
--set kubeControllerManager.enabled=true
-- set kubeScheduler.enabled=true
--set prometheusOperator.createCustomResource=true
--set grafana.smtp.existingSecret=smtp-secret
--set grafana.smtp.enabled=true 
-f values.yaml 
--namespace monitoring

The SMTP settings in grafana.ini file are not picked up

What you expected to happen:

Expected to see the SMTP settings in grafana settings console that are same as the one provided in grafana.ini file.

How to reproduce it (as minimally and precisely as possible):

helm upgrade --install prometheus stable/prometheus-operator 
--set kubeEtcd.enabled=true
--set kubeControllerManager.enabled=true
-- set kubeScheduler.enabled=true
--set prometheusOperator.createCustomResource=true
--set grafana.smtp.existingSecret=smtp-secret
--set grafana.smtp.enabled=true 
-f values.yaml 
--namespace monitoring

Anything else we need to know:

lifecyclstale

Most helpful comment

@andyadamides you could try this command. I use this --set pattern in grafana helm 3 install and it's works.

helm install -f value.yaml --set grafana."grafana\.ini"."auth\.generic_oauth".client_secret=${client_secret_value}

All 6 comments

I'm guessing the syntax is incorrect. Can you show more of your values.yaml?

It should look like this:

grafana:
  enabled: true
  grafana.ini:
    smtp:
       enabled: true
       host: smtp.gmail.com:587
       user: "[email protected]"
       password: "correct horse battery staple"
       skip_verify: true

grafana.ini should be a sub-element of grafana and not a parent element.

Also --set grafana.smtp.enabled=true is redundant since you already defined it in values.yaml and --set grafana.smtp.existingSecret=smtp-secret isn't required since you are defining the username/password in the yaml.

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.

Hi the above solution did not work for me - I am in a similar situation where I need to configure the client_secret(parent=auth.generic_oauth) as a --set value. Having tried various combinations the client_secret will not get picked up. What is the correct way to pass it through?

The full path in the .yaml is as follows:

grafana:
   grafana.ini:
       auth.generic_oauth:
             client_secret:""

Just to be clear, the question is how do I reference the client_secret property from my helm command with --set?

@andyadamides you could try this command. I use this --set pattern in grafana helm 3 install and it's works.

helm install -f value.yaml --set grafana."grafana\.ini"."auth\.generic_oauth".client_secret=${client_secret_value}

Yeap that worked - also suggested here

Was this page helpful?
0 / 5 - 0 ratings