I have a helmfile release with multiple charts. There are values.yaml inside each chart. Рow to make values inside those values.yaml change depending on environment? I know how to parameterize helmfile's values.yaml, but I can't find any way to throw those values further into the charts values.yaml. Can someone help me with that?
Asked
Active
Viewed 8,000 times
2 Answers
1
If you name a values file anything.yaml.gotmpl
, then Helmfile will apply its templating to that file before using it as values to install the relevant chart.
So if your helmfile.yaml
says
environments:
prod:
values:
- domain: prod.example.com
releases:
- name: a-service
namespace: a-service
chart: ./a-service/charts/a-service
values:
- ./a-service/charts/a-service/values.yaml.gotmpl # <-- *.gotmpl filename
then the values.yaml.gotmpl
can have
service:
annotations:
external-dns.alpha.kubernetes.io/hostname: >-
a-service.{{ .Values.domain }}
{{/* Expression ^^^^^^^^^^^^^^ uses per-environment values */}}
and you can install this with
helmfile -e prod apply

David Maze
- 130,717
- 29
- 175
- 215
0
Just realized that helmfiles values.yaml it's just a source for helm --values. No special actions should be done.

Kaama
- 25
- 1
- 6