KubeDojo

Kustomize: Bases, Overlays, and Patches

AK
by Alexis Kinsella··12 min read
Kustomize: Bases, Overlays, and Patches

You have one application. Three environments: development, staging, production. Each needs different configuration — replica counts, resource limits, environment variables, maybe even different container images. Your first instinct: copy the YAML files three times. Six months later, you're editing Deployments in twelve directories, missing changes in production, and wondering where it all went wrong.

Kustomize solves this with the base/overlay pattern. Write your base configuration once — plain Kubernetes YAML, no templates. Then create overlays for each environment that customize the base: change replica counts here, add labels there, override image tags for production. The base stays untouched. Overlays declare what to change. Kustomize generates the final YAML.

Sign in to access this lesson

Create a free account or sign in to enroll in the CKA — Certified Kubernetes Administrator course and access all 63 lessons.

CKA — Certified Kubernetes Administrator

63 lessons

Browse the full course curriculum →