Conditional Blocks with if and else
Rendering resources only when configured.
Render Only When Needed
Sometimes a resource should appear only if the user asked for it. Helm lets you wrap that YAML in a conditional so it renders on demand.
The if Action
An if block starts with {{ if SOMETHING }} and closes with {{ end }}. Everything in between renders only when the condition is true.
{{ if .Values.ingress.enabled }}
# ingress yaml here
{{ end }}All lessons in this course
- Conditional Blocks with if and else
- Truthiness and Operators in Conditions
- Looping Over Lists and Maps with range
- Scoping a Block with with