I have a helm chart that is using some kind of custom template references (as far as I understand). This is the .tpl
file:
{{- define "common.secret._header" -}}
{{- $global := .global }}
{{- $name := .name }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $name }}
namespace: {{ include "common.namespace" $global }}
labels:
app: {{ include "common.name" $global }}
chart: {{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}
release: {{ include "common.release" $global }}
heritage: {{ $global.Release.Service }}
{{- end -}}
I am used to having the predefined .Values
or .Release
template references, but I have never seen the .global
or .name
references before. I guess they are custom defined versions of the same concept.
Can someone explain the general mechanism behind this and how they are assigned?