Helmfile combined with subcharts

82 Views Asked by At

I currently have a parent helm chart that contains one subchart. The only reason actually I'm using the parent chart, is because it contains a _helpers.tpl file with useful templates that I want to share across my subcharts (once I have more), for example, a template helper for a service yaml. However, for some reason the subchart custom values files are not applied correctly, although they contain valid yaml and are referenced correctly. Also, helmfile template actually used to produce valid yamls until I created multiple values files and moved them to the values folder. This is the helmfile:

environments:
  local:
  production:

---

releases:
  - name: my-app
    chart: ./parent-chart
    values:
      - ./parent-chart/values.yaml
      - ./parent-chart/charts/child-chart/values/common.yaml
      - ./parent-chart/charts/child-chart/values/local.yaml

More specifically, the error occurs when referencing {{ .Values.image.repository }}, because it says it can't find the image definition, although it is in the common.yaml:

image:
  repository: myrepo/myimage
  tag: "1.0.0"

Does the helmfile look valid? Or maybe helmfile is not intended to work with subcharts? Anyhow, I would like to find a way to share templates between multiple charts. Thanks.

0

There are 0 best solutions below