helm doesnt use the values.yaml file

12/24/2019

Im using helm to install prometheus operator with stable chart and it take all the config as expected,

This is the values.yaml

grafana:
  enabled: true
alertmanager:
  enabled: true
  alertmanagerSpec:
    replicas: 3
  image:
    repository: quay.io/prometheus/alertmanager
    tag: v0.20.0

when I run helm install mon stable/prometheus-operator -n mon -f values.yaml
everything is working just fine, I was able to see 3 alert manager instances and see the version in the logs 0.20.0

Now I need to do some configuration that I’ve created and helm chart with helm create v2chart

add my config file to the template folder of the chart and add the following requirements.yaml and run helm dep update ./v2chart

dependencies:
  - name: prometheus-operator
    version: 8.5.0
    repository: https://kubernetes-charts.storage.googleapis.com

I see now inside the chart folder under the root prometheus-operator-8.5.0.tgz

now running on the root I run helm helm install mon -f values.yaml . -n mon

and it takes the default charts values and not my values.yaml config ( I see only 1 instance of the alert manager with version 0.19 )

What am I missing here?

btw, I see that the config file in the template is configured correctly however it doesnt take the values.yaml during installation ...

-- Jon lib
amazon-web-services
azure
kubernetes-helm
prometheus
prometheus-operator

1 Answer

12/24/2019

I think it should look like this:

prometheus-operator: << this should match the name you are using in requirements.yaml for that particular subchart
  grafana:
    enabled: true
  alertmanager:
    enabled: true
    alertmanagerSpec:
      replicas: 3
    image:
      repository: quay.io/prometheus/alertmanager
      tag: v0.20.0

so basically you should let it know that these values are for the subchart, not for the parent chart

https://helm.sh/docs/topics/chart_template_guide/subcharts_and_globals/#overriding-values-from-a-parent-chart

-- 4c74356b41
Source: StackOverflow