Back to Glossary
Operations

Kustomize

A Kubernetes-native configuration management tool that customizes base manifests for different environments without templating.

What is Kustomize?

Kustomize is a built-in Kubernetes configuration management tool (available via kubectl apply -k or as a standalone binary) that enables environment-specific customization of base manifest sets without using templates. Instead of Go templates with conditionals and loops, Kustomize uses a declarative overlay model: a base directory contains the canonical resource definitions, and each environment (staging, production) has its own overlay directory with a kustomization.yaml that specifies which base to use and what patches to apply.

kustomization.yaml supports several types of modifications: patches (strategic merge patches or JSON patches that modify specific fields in base resources), namePrefix/nameSuffix (prepend or append strings to all resource names), images (substitute image references), replicas (override replica counts), configMapGenerator and secretGenerator (create ConfigMaps/Secrets from files or literals with automatic content hashing for rolling updates), and vars (substitute values from one resource into another).

Kustomize is built into kubectl since version 1.14, making it dependency-free for clusters that already have kubectl. It integrates naturally with GitOps tools like ArgoCD and Flux, which natively understand kustomize overlays and can render them server-side. Unlike Helm, Kustomize has no concept of a release or rollback — it is purely a manifest transformation layer.

Example

# Directory structure:
# base/
#   deployment.yaml
#   service.yaml
#   kustomization.yaml
# overlays/production/
#   kustomization.yaml  (references ../base)
#   replica-patch.yaml  (sets replicas: 10)

# overlays/production/kustomization.yaml
resources:
  - ../../base
replicas:
  - name: web-api
    count: 10
images:
  - name: my-org/web-api
    newTag: v2.1.0

# Apply an overlay
kubectl apply -k overlays/production/

Cost & Waste Implications

Kustomize overlays make it easy to maintain separate resource configurations for dev and production, including lower replica counts and smaller resource requests in dev. Without this separation, dev environments often run with production-scale resources, significantly inflating non-production infrastructure costs. Kustomize's configMapGenerator also adds a content hash suffix to ConfigMap names, causing automatic Pod restarts on config changes — this eliminates stale config bugs but can cause unexpected rollouts.

KorPro— Kubernetes Cost Optimization

How KorPro Helps

KorPro's resource analysis works alongside Kustomize-managed clusters, identifying resources in staging and dev overlays that mirror production sizing and would benefit from environment-specific right-sizing.

Scan Your Cluster Free

Stop Wasting Money on Orphaned Kubernetes Resources

KorPro connects to your clusters across GCP, AWS, and Azure — no agents, no installation — and surfaces every orphaned resource with its monthly cost estimate.