What is `_helpers.tpl` and what usually goes in it?
BeginnerConceptChart Structure & Metadata
Answer
A conventional file of named templates that keep names and labels consistent. Typical helpers: <chart>.name, <chart>.fullname, <chart>.chart, <chart>.labels, <chart>.selectorLabels, <chart>.serviceAccountName, and an image reference helper.
{{- define "shop.selectorLabels" -}}
app.kubernetes.io/name: {{ include "shop.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
The underscore prefix stops Helm rendering it as a manifest; the .tpl extension is convention only.
More on Chart Structure & Metadata
What files does `helm create mychart` generate and which ones matter?BeginnerWhat are the required fields in `Chart.yaml`?BeginnerWhat is the difference between `version` and `appVersion`?BeginnerWhy should `appVersion` be quoted in `Chart.yaml`?BeginnerWhat does `type: library` vs `type: application` mean?BeginnerWhat is the `kubeVersion` field used for?Intermediate