You are on page 1of 2

12

Helm templates primer


Basic Helm template rules
• Anything between {{ and }} is rendered. For example {{lower “HeLLo"}} is rendered as hello.

• You can get a value using the .Values keyword followed by the property. For
example, .Values.service.port

• The include function embeds another template. The second argument specifies the variable scope for
the embedded template. We often use dot (.) to indicate root

• Helm functions accept parameters on the same line separated by spaces (no brackets or commas)

• Embedded templates can be found in _helpers.tpl file and can be called using the include function

• The pipe “|” symbol works the same way it does in Linux. For example, {{ print "Hello" | trunc
2 }} yields “He”

• The dash “-“ at the code start removes any whitespace preceding the generated output. Placing it at the
end removes any whitespace after the generated output

• It’s often used with the indent or the nindent functions, which ensures that the stripped output is
correctly indented.
.

You might also like