In the Kubernetes world, Helm umbrella charts allow the provisioning of sub-charts through the parent-child mechanism. A child chart placed in the the charts folder in Helm can be deployed by declaring the sub-chart in the parent’s Charts.yaml file. One neat feature of Helm is the ability to push values from parent (umbrella) charts down to sub-charts by making use of global variables as shown below.

global:
  foo: bar

By specifying the global variable, sub-charts can now reference the global value in the parent’s values.yaml file as follows.

{{- if .Values.global.foo }}
  key1: {{ .Values.global.foo }}
{{- else }}
  key1: {{ .Values.foo }}
{{- end }}

#helm #kubernetes #global-variable

Helm 3 Umbrella Charts & Global Values in Sub-Charts
20.30 GEEK