DevOps Bootcamp · Lesson

How --set and -f Are Merged

Precedence rules when overrides overlap.

Lesson 4 of 413 steps

How --set and -f Are Merged is a free DevOps Bootcamp lesson on CoddyKit. This is lesson 4 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.

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

Free to start

Learn DevOps Bootcamp with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
142
Lessons
568

Frequently Asked Questions

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

Yes — any 3 lessons of the DevOps Bootcamp learning path, including “How --set and -f Are Merged”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.

What will I learn in “How --set and -f Are Merged”?

Precedence rules when overrides overlap. You practise DevOps Bootcamp 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 DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 4 of 4.

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 DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp 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 DevOps Bootcamp