Common deployment and service definitions
DevOps & Tooling / Knowledge library
Kustomize
base manifests overlays and template-free customization
Why learn Kustomize?
Useful for maintaining shared configuration with environment-specific changes. Rendered manifests should be inspected and validated before applying them.
Where it came from
Kustomize customizes Kubernetes resource manifests using bases, overlays, and transformations. It works with declarative YAML rather than requiring a separate template language.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Render a base manifest without applying it.
- Create an overlay for a test environment.
- Patch an image or replica setting.
- Inspect the final resource names and labels.
- Compare two overlays for unintended differences.
Documentation and sources
- Official project documentation (kustomize.io)
Catalog research notes
- Research snapshot: September 9, 2026. This entry summarizes the linked primary documentation; it does not assert a latest release version.
Connect the ideas
Alternatives
Explore next
Real World Example
Unified Global Retail Configuration Management
A global retail chain managing Kubernetes clusters across multiple regional data centers.
The business problem
The engineering team faces significant operational overhead due to maintaining duplicated YAML manifests for each region, leading to configuration drift and manual error-prone updates when applying environment-specific patches.
How this topic solves it
Kustomize enables a template-free approach by utilizing a base directory containing common resource definitions, while regional overlays apply environment-specific patches and strategic merges without modifying the original source files.
- Define a base directory containing standard deployment and service YAML files.
- Create regional overlay directories for each deployment target.
- Define a kustomization.yaml file in each overlay to reference the base.
- Apply environment-specific patches or common labels within the overlay kustomization files.
- Execute kubectl apply -k to generate and deploy the final merged configuration.
This diagram illustrates how a base configuration is transformed into regional deployments through overlays.
US-specific patches and labels
EU-specific patches and labels
Final rendered configuration
Final rendered configuration
- Base Manifests → inherits → US Overlay
- Base Manifests → inherits → EU Overlay
- US Overlay → renders → US Cluster
- EU Overlay → renders → EU Cluster
Expected business outcome
The team achieves a single source of truth for base configurations while maintaining the flexibility to inject regional requirements, significantly reducing configuration drift and manual maintenance effort.
Limitations and checks
Kustomize does not support complex conditional logic or looping constructs found in templating engines; verify configuration state by running kubectl kustomize to inspect the final rendered output before applying.