1

Is there a way to filter yaml files used in a helmfile?

I have a values.yaml:

component-a:
  key1: value
  key2: value
component-b:
  key1: value
  key3: value

In the helmfile I load the yaml and want to filter for a component template:

templates:
  component: &component
  chart: oci://myregistry/{{`{{ .Release.Name }}`}}
  values: 
    - values.yaml | TODO filter for .Release.Name

releases:
  - name: component-a
  <<: *component
  - name: component-b
  <<: *component

I would like to have the values for both components in one file and only the ones for the release name filtered in the component template.

Matthias Baumgart
  • 905
  • 1
  • 9
  • 22
  • I might experiment with `{{ index .Values .Release.Name | toYaml }}` and see if something along these lines works? In the environment where I use Helmfile I have a separate values file per service, `values: [ values/{{ .Release.Name }}.yaml ]` and that's more straightforward to set up. – David Maze Apr 08 '22 at 13:24

0 Answers0