docs / articles / Helm Template Range

Helm Template Range

Noah Aug 16, 2026 2026-08-16 04:58:21

In the realm of Kubernetes (K8s) infrastructure, Helm is a powerful package manager that simplifies application deployment and management. A crucial aspect of Helm is its ability to manipulate resources in a controlled and predictable manner, which is achieved through the use of Templates and Ranges.

Templates — SKS PROPS
Templates — SKS PROPS

Helm Templates are GO templates that render Kubernetes manifests, allowing users to parameterize values and create dynamic configuration. They enable users to define placeholders for values, which can then be filled when the template is rendered. This render process is where Helm Ranges come into play, enabling the creation of dropdown lists of options for these values.

the helmet and visor are shown in three different positions
the helmet and visor are shown in three different positions

Understanding Helm Templates and Ranges

Helm Templates are fundamental to the flexibility and efficiency of Helm. They allow users to create reusable, structured configurations for their Kubernetes resources. By defining placeholders using GO template syntax, users can parameterize values that can vary between deployments. This could include environment-specific configurations, or options that need to be chosen at runtime.

Drawing of a knight's helmet
Drawing of a knight's helmet

Helm Ranges, on the other hand, provide a way to define dropdown lists of options for these values. They allow users to define a set of possible values for a parameter, creating a user-friendly interface where the user can select from these options during installation or upgrade.

Defining Parameters in Helm Templates

the heinet base build template is shown in three different sizes, including one for each
the heinet base build template is shown in three different sizes, including one for each

In Helm Templates, parameters are defined using the `{{ .Values.parameter }}` syntax. This syntax tells Helm to replace `{{ .Values.parameter }}` with the actual value provided when the template is rendered. For example:

`replicas: {{ .Values.replicaCount }}`

Using Ranges in Helm Templates

an image of a helmet with measurements and instructions for the parts to be used in this project
an image of a helmet with measurements and instructions for the parts to be used in this project

To use Helm Ranges, you first define the range in the chart's `values.yaml` file using the `range` keyword. Then, use the `{{ range }}` `{{ end }}` syntax in your templates to loop over the values provided by the range.

Here's a simple example. Suppose you want to create a range for the `replicaCount` parameter, offering options of 1, 2, and 3. In the `values.yaml`, you would define the range like this:

`replicaCountRange:

Firefighter Helmet Shield Silhouette Images – Browse 920 Stock Photos, Vectors, and Video
Firefighter Helmet Shield Silhouette Images – Browse 920 Stock Photos, Vectors, and Video

Then, in your template, you could use it like this:

{{ range .Values.replicaCountRange }}{{ end }}

three views of the front, back and side of a motorcycle helmet on a white background
three views of the front, back and side of a motorcycle helmet on a white background
three different views of a motorcycle helmet
three different views of a motorcycle helmet
CARDBOARD FIREMAN HELMET
CARDBOARD FIREMAN HELMET
Viking Helmet Template – Medium
Viking Helmet Template – Medium
the diagram shows how to cut and sew with scissors, which are also used for sewing
the diagram shows how to cut and sew with scissors, which are also used for sewing
Helmet Outline
Helmet Outline
the top half of a sewing pattern with measurements for the front and back side of it
the top half of a sewing pattern with measurements for the front and back side of it
four different helmets with horns on the sides and one in the middle, all made up of
four different helmets with horns on the sides and one in the middle, all made up of
Résultats Google Recherche d'images correspondant à https://thumbs.dreamstime.com/b/d-illustration-conquistador-morion-helmet-isolated-different-backgrounds-170847159.jpg
Résultats Google Recherche d'images correspondant à https://thumbs.dreamstime.com/b/d-illustration-conquistador-morion-helmet-isolated-different-backgrounds-170847159.jpg

Benefits of Using Helm Templates and Ranges

Using Helm Templates and Ranges offers several benefits. Firstly, they promote reusability. By parameterizing your templates, you can create a single, reusable template that can be adapted to different scenarios by changing the values and ranges.

Secondly, they simplify the user experience. Ranges in particular provide a user-friendly interface for selecting from a set of predefined options. This can make your charts more accessible and easier to use, especially for less technical users.

last paragraph in a natural and human-like way...