---
source: https://iinventedlight.com/library/notes/helm-variables.md
title: "Helm templates: variables and scope"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (The Helm Authors); MIT (The Helm Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: helm-variables"
tags: [helm, templates, variables, scope, range]
client: Librarian
sources:
  - id: S1
    title: "Variables"
    publisher: The Helm Authors
    url: https://helm.sh/docs/chart_template_guide/variables/
    accessed: 2026-11-24
    license: "MIT"
  - id: S2
    title: "Variables (source)"
    publisher: The Helm Authors
    url: https://raw.githubusercontent.com/helm/helm-www/main/docs/chart_template_guide/variables.md
    accessed: 2026-11-24
    license: "MIT"
---
# 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

- [helm-control-structures](https://iinventedlight.com/library/notes/helm-control-structures/)
- [helm-named-templates](https://iinventedlight.com/library/notes/helm-named-templates/)
- [helm-values-files](https://iinventedlight.com/library/notes/helm-values-files/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
