0PricingLogin
Helm Academy · Lesson

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

  1. Conditional Blocks with if and else
  2. Truthiness and Operators in Conditions
  3. Looping Over Lists and Maps with range
  4. Scoping a Block with with
← Back to Helm Academy