0Pricing
Helm Academy · Lesson

The Values Object and Nested Access

Reading user configuration deep in the tree.

The Values Object and Nested Access is a free Helm Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Helm Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Meet the Values Object

Inside a template, .Values holds every setting from your chart's values.yaml plus any overrides you passed. It is your config tree.

Reading a Top-Level Key

A top-level key like replicaCount becomes .Values.replicaCount. The dot path mirrors the YAML structure exactly. 🌳

# values.yaml
replicaCount: 3

# template
replicas: {{ .Values.replicaCount }}

Diving Into Nested Maps

When values nest, you chain dots. The map image with a key tag is reached as .Values.image.tag, one segment per level.

# values.yaml
image:
  repository: nginx
  tag: "1.27"

# template
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}

Keys Are Case-Sensitive

Path segments must match the YAML key character for character. .Values.Image is not the same as .Values.image and renders empty.

Missing Keys Render Empty

Asking for a value that does not exist is not an error by default. Helm renders nothing, which can silently produce invalid YAML.

Keys With Dashes Need index

Dot syntax breaks on keys with dashes. Reach them with the index function and the key as a quoted string instead.

# values.yaml
service-port: 8080

# template
port: {{ index .Values "service-port" }}

Where Default Values Come From

The chart author ships sane defaults in values.yaml. Every key there is available under .Values unless a user overrides it.

How Overrides Reach .Values

A user's --set flag or -f file is merged on top of defaults before rendering. By template time, .Values is the final merged tree.

helm install web ./mychart --set replicaCount=5

Lists Live Under .Values Too

A YAML list becomes a slice under .Values. You range over it to render repeated items rather than reading it with a single dot path. 🔁

# values.yaml
ports:
  - 80
  - 443

Quoting Values Safely

Numbers and booleans render raw, which can corrupt YAML. Wrap user strings in the quote function so they stay valid text.

tag: {{ .Values.image.tag | quote }}

Inspect the Tree Before You Use It

Run helm show values on a chart to print its full values tree. That output is the exact shape you address with .Values.

helm show values ./mychart

Quick Check

You need a values key named service-port that contains a dash.

Recap: The Values Tree

You learned that .Values is the merged config tree, addressed with dotted paths, case-sensitively, with index for awkward keys. Inspect it with helm show values.

Frequently asked questions

Is the “The Values Object and Nested Access” lesson free?

Yes — the full text of “The Values Object and Nested Access” is free to read here on the web, and the Helm Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Helm Academy course, upgrade to CoddyKit PRO.

What will I learn in “The Values Object and Nested Access”?

Reading user configuration deep in the tree. You practise Helm Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Helm Academy?

No prior experience is required. Helm Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “The Values Object and Nested Access” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Helm Academy lesson?

Yes. Every Helm Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. The Values Object and Nested Access
  2. Release Metadata via .Release
  3. Chart and Capabilities Objects
  4. Files, Template, and the Root Context
← Back to Helm Academy