2

I am currently trying to test some changes, specifically to see if a chart picks up/inherits changes from a top level values file. This top level values file should override any settings in the values file for this chart. To test this, I am trying to use the following command:

helm template --values path/to/top/level/values.yaml path/to/chart > output.yaml

However, when viewing the output for this, the chart still retains the values defined in the chart, and not the values that have been set in the top level values file.

I have tried a number of variations of this command, such as:

helm template path/to/chart --values path/to/top/level/values.yaml > output.yaml

helm template -f path/to/chart/values.yaml --values path/to/top/level/values.yaml > output.yaml

helm template path/to/top/level/values.yaml --values path/to/chart > output.yaml

Am I using this command correctly? Is what I am trying to achieve only possible when doing a helm install or upgrade? e.g. https://all.docs.genesys.com/PrivateEdition/Current/PEGuide/HelmOverrides

HollowDev
  • 111
  • 1
  • 8
  • The `helm template` syntax seems fine (you shouldn't need to directly reference the chart's own `values.yaml` file). Do the layouts of the two YAML files match? Are you expecting the chart you're testing to be deployed as a subchart of the top-level chart, or is the top-level values file something that could be used in a standalone installation (maybe using a tool like Helmsman or Helmfile)? – David Maze Jun 23 '22 at 10:36

2 Answers2

2

Overriding values from a parent (you call it top-level) chart mychart works like a charm and exactly as described in the Helm docs.

A values.yaml in folder mychart/charts/mysubchart

dessert: cake

can be overriden by a values.yaml in folder mychart

mysubchart:
  dessert: ice cream

Any directives inside of the mysubchart section will be sent to the mysubchart chart.

Rendering the parent (top-level) chart works like that:

helm template mychart -f mychart/values.yaml
Sascha Gottfried
  • 3,303
  • 20
  • 30
  • Thanks for the answer. Unfortunately, I don't think that works. This is what I have ran: `helm template path/to/chart -f external/dir/path/to/values.yaml > output.yaml` Viewing the output still shows that the chart retains the values set in the chart itself, rather than be overridden the values file (which is in a different repo/directory). – HollowDev Jun 22 '22 at 14:51
  • I suggest to add more details to your question especially absolute file paths, commands, command output and expected command output. – Sascha Gottfried Jun 23 '22 at 05:25
  • Hi, I managed to get it working in the end. The solution that worked for in the end was: helm template --values external/dir/path/to/values.yaml path/to/chart > output.yaml – HollowDev Jun 23 '22 at 14:45
  • 1
    `--values` is nothing else than `-f` - see `helm template --help`. The order of [Chart] and [flags] does not matter for this specific case. I recommend to align with order of arguments given in help/command usage. – Sascha Gottfried Jun 25 '22 at 09:38
0

What if what you want is to combine from 2 yaml files, is it possible?

Example:

values.yaml:

blackBoxSidecar:
  enabled: true
  targets:
    - target: esb:443
      module: tcp_connect

values-namespace.yaml:

blackBoxSidecar:
  targets:
    - target: rabbitmq-namespace:443
      module: tcp_connect

What I want to get is:

blackBoxSidecar:
  enabled: true
  targets:
    - target: esb:443
      module: tcp_connect
    - target: rabbitmq-namespace:443
      module: tcp_connect