← All notes

Helm flow control: if, with, and range in chart templates

Answer: Helm's template language provides the following control structures.

The main actions

Control structures, called actions in template parlance, give you the ability to control the flow of a template's generation.

if and else are for creating conditional blocks.

with is used to specify a scope.

range provides a for each-style loop.

Where the rest lives

The others are covered in the Named Templates section later in this guide.

Let's add a simple conditional to our ConfigMap.

A pipeline is evaluated as false for the empty or zero-like values listed on the page.

The first control structure the page looks at is for conditionally including blocks.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Helm Authors, Flow Control; The Helm Authors, Flow Control (source). MIT (https://raw.githubusercontent.com/helm/helm-www/main/LICENSE). Copyright The Helm Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Helm Authors, Flow Control; The Helm Authors, Flow Control (source). MIT (https://raw.githubusercontent.com/helm/helm-www/main/LICENSE). Copyright The Helm Authors.

Cite this

Permanent ID: iil:note:yg2yk158

iinventedlight. 2026. "Helm flow control: if, with, and range in chart templates." iinventedlight Library, iil:note:yg2yk158, version of 2026-11-24. https://iinventedlight.com/library/notes/helm-control-structures/. License: CC-BY-4.0.

@misc{iil_note_yg2yk158,
  author = {{iinventedlight}},
  title = {{Helm flow control: if, with, and range in chart templates}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-24},
  url = {https://iinventedlight.com/library/notes/helm-control-structures/},
  note = {Permanent ID iil:note:yg2yk158. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/helm-control-structures.md.