I'm new to Helm.
I have a default value in parent chart. I want to use this value in each subchart by default, but also to have a possibility to override the value for a specific subchart.
Example:
# Parent-chart values.yaml
global:
schedule: 10m
All the subcharts will use this value by default. But if I run something like this:
helm install --set subchart-A.schedule="20m"
Subchart-A will use value "20m".
I'm thinking about two possibilities:
- Maybe I can somehow link subchart-value to global value:
# Subchart values.yaml
schedule: {{ .Values.global.schedule }} # it doesn't work
In that case, it would be possible to override a specific value for the single subchart.
- Maybe I can write a function
# Pseudocode:
if subchart.schedule is null
printf global.schedule
else
printf subchart.schedule
What would you do and what is generally possible?
default
? something like{{ .Values.global.schedule | default subchart-A.schedule }}
helm.sh/docs/topics/chart_template_guide/variables – hmatt1