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
- Declaring a Library Chart Type
- Exporting Reusable Named Templates
- Consuming a Library as a Dependency
- Overriding Library Defaults Locally