Kustomize Basics
One base, one overlay per environment, no templating language. The feature that earns its keep is the generated ConfigMap name hash, which makes a config change roll your Pods instead of leaving them on stale values.
Cluster Architecture and Configuration Guide 19 of 103 Intermediate
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 35 min
Kustomize is built into kubectl, and the embedded version lags the standalone binary. Some field names changed across versions, commonLabels to labels and patchesStrategicMerge to patches among them.
- kustomize (in kubectl)v5.8.1
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when one application has to reach several environments without a templating language. This matters because Kustomize is already inside kubectl, and its generated ConfigMap hash is what makes a config change actually roll your Pods.
- finding the Kustomize version embedded in kubectl, which lags the standalone binary
- rendering a base with
kubectl kustomizewithout applying anything - reading an overlay and the transformers that make it differ from its base
- watching
configMapGeneratorwithbehavior: mergecombine rather than replace - changing one literal and seeing the generated name hash change, which is what rolls the Pods
Before you start
- The Deployments and ConfigMaps and Secrets guides.
kubectl1.14 or later, which has kustomize built in. Nothing to install.
-
Nothing to install, and a version worth knowing
-
The base, rendered
-
The overlay, and the six transformers worth knowing
-
Generator behaviour, and applying it
-
The hash is the feature: a config change rolls the Pods