Example Documentation: Kustomize Overlays
Goal
Manage common base resources with dev and prod overlays.
What Is Done
The base defines Namespace, Deployment, Service and ConfigMap. The overlays change namespace, prefix, labels, replicas and ConfigMap values.
Typical Commands
kubectl kustomize base/
kubectl kustomize overlays/dev/
kubectl kustomize overlays/prod/
kubectl apply -k overlays/dev/
kubectl apply -k overlays/prod/
Validate Success
- Dev renders one replica.
- Prod renders three replicas.
- ConfigMap values differ between dev and prod.
Common Mistakes
- Overlays are run from the wrong directory.
- Name prefixes are not considered for Service references.
- Generated ConfigMaps receive unexpected hash suffixes.