0Pricing
Helm Academy · Lesson

How --set and -f Are Merged

Precedence rules when overrides overlap.

How --set and -f Are Merged is a free Helm Academy lesson on CoddyKit — lesson 4 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.

Layers of Values

Helm builds the final config in layers. It starts with the chart defaults, then applies every override you supply on top. 🧱

Defaults Sit at the Bottom

The chart's own values.yaml is always the base layer. Anything you do not override keeps its default value.

Files Apply Over Defaults

Each -f file is merged on top of the defaults, in the order you list them. Later files beat earlier ones.

helm install web ./chart -f a.yaml -f b.yaml

--set Sits on Top

Here is the key rule: --set values are applied last of all. They override both the chart defaults and your -f files.

helm install web ./chart -f prod.yaml --set replicaCount=5

The Full Precedence Order

From lowest to highest: chart defaults, then -f files left to right, then --set. The highest layer wins each key.

A Worked Example

If prod.yaml sets replicaCount to 3 but you add --set replicaCount=5, the release runs with 5 replicas.

-f prod.yaml --set replicaCount=5  # 5 wins

Maps Merge, Keys Replace

Helm deep-merges nested maps, combining their keys. Within a single key, the higher layer simply replaces the lower value.

Lists Replace, Not Append

Watch out: a list in a higher layer fully replaces the lower list. It does not append items to it.

Untouched Keys Survive

Overriding one key never wipes its siblings. Keys you do not mention keep their value from the layer below.

Inspect the Result

To see the merged outcome, add --dry-run --debug at install time and read the computed values Helm prints.

helm install web ./chart -f prod.yaml --set replicaCount=5 --dry-run --debug

Pick the Right Tool

Put stable config in files for review, and reserve --set for the few last-mile overrides that must win, like a CI build tag.

Quick Check

Let us confirm which override layer has the final say.

Recap

Precedence runs defaults, then -f files, then --set on top. Maps deep-merge, lists replace, and --dry-run --debug shows the result. ✅

Frequently asked questions

Is the “How --set and -f Are Merged” lesson free?

Yes — the full text of “How --set and -f Are Merged” 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 “How --set and -f Are Merged”?

Precedence rules when overrides overlap. 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 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “How --set and -f Are Merged” 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. Inspecting Defaults with helm show values
  2. Override on the CLI with --set
  3. Supplying a Custom values File with -f
  4. How --set and -f Are Merged
← Back to Helm Academy