0PricingLogin
Helm Academy · Lesson

Exporting Reusable Named Templates

Publishing partials other charts can include.

Named Templates Are the Payload

A library chart ships its value as named templates. You write them with define, exactly as you would in any _helpers.tpl file.

{{- define "common.fullname" -}}
{{ .Release.Name }}-{{ .Chart.Name }}
{{- end -}}

Namespace Your Template Names

Template names are global across a chart and its dependencies. Prefix yours with the library name, like common.labels, to avoid collisions.

{{- define "common.labels" -}}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

All lessons in this course

  1. Declaring a Library Chart Type
  2. Exporting Reusable Named Templates
  3. Consuming a Library as a Dependency
  4. Overriding Library Defaults Locally
← Back to Helm Academy