Interview Prep/Helm/Chart Structure & Metadata

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.

All Helm questions Roadmap: Helm

More on Chart Structure & Metadata