Override values of Subcharts inHelm

11/7/2019

We have created common helm charts. Using the common charts, we have derived HelloWorld helm chart

Charts
  Common
    templates
      > _deployment.yaml
      > _configmap.yaml
      > _service.yaml
    Chart.yaml

  HelloWorld
    templates
      > deployment.yaml 
      > configmap.yaml
      > service.yaml
    Chart.yaml
    values.yaml 
    values-dev.yaml 

We wanted to override values specified values.yaml (subchart) using values-dev.yaml , We understand we can override the values from the subchart. The values can be overrided.

However, we wanted to override the values for chart level instead of app level. Below is the structure.

Charts
  Common
    templates
      > _deployment.yaml
      > _configmap.yaml
      > _service.yaml
    Chart.yaml

  HelloWorld1
    templates
      > deployment.yaml 
      > configmap.yaml
      > service.yaml
    Chart.yaml
    values-HelloWorld1.yaml 
    values-dev.yaml 

    HelloWorld2
      templates
        > deployment.yaml   
        > configmap.yaml
        > service.yaml
      Chart.yaml
      values-HelloWorld2.yaml   
      values-qa.yaml    

values.yaml

Is it possible to override the values from values.yaml?

-- Sunil Gajula
helmfile
kubernetes
kubernetes-helm

1 Answer

11/7/2019

I'm not 100% sure what you're asking, but in general you can override subchart values at any point by putting them under a key matching the charts name. So something like:

Common:
  foo: bar
-- coderanger
Source: StackOverflow