Defining a Partial with define
Declaring a reusable named template block.
Why Repeat Yourself?
The same labels and names get copied into every manifest in a chart. A named template lets you write that block once and reuse it everywhere.
Meet the define Action
You declare a reusable block with the define action. It names a chunk of template text but does not render anything on its own.
{{- define "mychart.labels" -}}
app: my-app
{{- end -}}All lessons in this course
- Defining a Partial with define
- Inserting Partials with template and include
- The Standard Fullname and Labels Helpers
- Passing Scope into a Named Template