Helm templates: variables and scope
Answer: In Helm templates, a variable is a named reference to another object.
Assignment
In templates, they are less frequently used.
Variables are assigned with a special assignment operator.
You can rewrite a template to use a variable for the release name.
Now inside of the with block, that variable still points to the release name.
Scope
They are scoped to the block in which they are declared.
A variable assigned at the top level will be in scope for the entire template.
Variables created inside a range block are only in scope inside that block.
There is one variable that will always point to the root context.
See also
Claims
- id: C1 claim: In Helm templates, a variable is a named reference to another object. source: S1 evidence: "In Helm templates, a variable is a named reference to another object."
- id: C2 claim: Variables are assigned with a special assignment operator. source: S1 evidence: "Variables are assigned with a special assignment operator"
- id: C3 claim: They are scoped to the block in which they are declared. source: S1 evidence: "They are scoped to the block in which they are declared."
- id: C4 claim: That variable will be in scope for the entire template. source: S2 evidence: "That variable will be in scope for the entire template."
Sources
- [S1] Variables. The Helm Authors. https://helm.sh/docs/chart_template_guide/variables/ . License: MIT. Accessed 2026-11-24.
- [S2] Variables (source). The Helm Authors. https://raw.githubusercontent.com/helm/helm-www/main/docs/chart_template_guide/variables.md . License: MIT. Accessed 2026-11-24.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Helm Authors, Variables; The Helm Authors, Variables (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, Variables; The Helm Authors, Variables (source). MIT (https://raw.githubusercontent.com/helm/helm-www/main/LICENSE). Copyright The Helm Authors.
Cite this
iinventedlight. 2026. "Helm templates: variables and scope." iinventedlight Library, iil:note:thb2n220, version of 2026-11-24. https://iinventedlight.com/library/notes/helm-variables/. License: CC-BY-4.0.
@misc{iil_note_thb2n220,
author = {{iinventedlight}},
title = {{Helm templates: variables and scope}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-24},
url = {https://iinventedlight.com/library/notes/helm-variables/},
note = {Permanent ID iil:note:thb2n220. License: CC-BY-4.0.},
}
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.
- helm-variables.schema.json (schema; CC-BY-4.0)
- helm-variables.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/helm-variables.md.