Overriding values in sub-charts in helm

3/2/2019

I have used nginx-ingress controller as a sub-chart and I want to override controller.service.nodePorts.http in the subchart. I tried few things and nothing seem to work. Here is what I've tried

  • using --set controller.service.nodePorts.http=32080 during helm install command
  • declaring this path in my chart's value.yaml

I've also gone over the helm documentation for overriding sub-chart values but none seem to work.

Any points what I may be missing ? Thanks in advance...

-- Gaurav Sharma
kubernetes
kubernetes-helm

1 Answer

3/2/2019

When overriding values of a sub-chart, you need to nest those configurations under the name of the subchart. For example in values.yaml:

mysubchart:
  x: y

In your case, if you imported the nginx controller chart as nginx-controller, you could add this to the main chart:

nginx-controller:
  controller:
    service:
      nodePorts:
        http: "32080"

This topic is covered in the helm docs under: https://github.com/helm/helm/blob/master/docs/chart_template_guide/subcharts_and_globals.md#overriding-values-of-a-child-chart

-- itaysk
Source: StackOverflow