Intermediate By Samson Tanimawo, PhD Published Sep 8, 2026 5 min read

Kustomize Cheat Sheet

Kustomize is great until you need a list patch, then it's terrible until you remember JSON 6902 exists. The patterns that hold up after the third refactor.

Bases & overlays

The directory shape is the contract. Get it right once and adding environments is trivial; get it wrong and you'll keep rewriting paths.

Patches, strategic merge

Strategic merge is the default. It's YAML, it merges by key, and it's good enough for 80% of cases.

Patches, JSON 6902

When strategic merge fights you (lists are the usual culprit), drop to JSON 6902 patches. They use JSON Pointer paths and operate field-by-field.

Generators, configMap & secret

Generators build ConfigMaps and Secrets at render time, hash-suffix them, and update every reference automatically. Pods restart on config change without you tracking it.

vars & replacements

Vars are the legacy variable system; replacements is the modern replacement (Kustomize 4.5+). Use replacements in any new code.

Components

Components are reusable bundles of patches and resources you mix into multiple overlays. Think "logging sidecar I want on every prod deployment".