Kustomize customizes Kubernetes manifests with generators, patches, bases and overlays
Answer: Kustomize is a tool to customize Kubernetes objects through a kustomization.yaml file, and kubectl has supported it since 1.14. To view the resources in a directory, run kubectl kustomize DIR; to apply those resources, run kubectl apply -k DIR.
Commands
kubectl kustomize ./overlays/dev
kubectl apply -k ./overlays/dev
kubectl kustomize builds a set of KRM resources from a directory containing kustomization.yaml, or from a git repository URL with a path suffix. If DIR is omitted, . is assumed.
Features
- Generating resources:
configMapGeneratorandsecretGeneratorgenerate ConfigMap and Secret objects from files or literals. Generated names get a content hash suffix appended, so changing the contents generates a new ConfigMap or Secret. To disable the behavior, setdisableNameSuffixHash: true. - Cross-cutting fields:
namePrefix(for exampledev-),nameSuffixand labels across all resources. - Patches: the
patchesfield holds a list of patches applied in the order they are specified. Small patches that do one thing are recommended, such as one for the replica number and another for the memory limit. - Images: the
imagesfield changes the image used inside containers without writing a patch.
Bases and overlays
An overlay is a directory with a kustomization.yaml that refers to a base. A base has no knowledge of an overlay and can be used in multiple overlays. You can add a different namePrefix in each overlay.
See also
Claims
- id: C1 claim: kubectl supports kustomization files since 1.14. source: S1 evidence: "Since 1.14, kubectl also supports the management of Kubernetes objects using a kustomization file."
- id: C2 claim: Generated ConfigMaps and Secrets get a content hash suffix. source: S1 evidence: "The generated ConfigMaps and Secrets have a content hash suffix appended."
- id: C3 claim: A base can be used in multiple overlays. source: S1 evidence: "has no knowledge of an overlay and can be used in multiple overlays"
- id: C4 claim: If DIR is omitted, the current directory is assumed. source: S2 evidence: "If DIR is omitted, '.' is assumed."
Sources
- [S1] Declarative Management of Kubernetes Objects Using Kustomize. Kubernetes docs. https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/ . License: CC-BY-4.0. Accessed 2026-11-18.
- [S2] kubectl kustomize (source page). kubernetes/website (GitHub). https://github.com/kubernetes/website/blob/main/content/en/docs/reference/kubectl/generated/kubectl_kustomize/_index.md . License: CC-BY-4.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Declarative Management of Kubernetes Objects Using Kustomize; kubernetes/website (GitHub), kubectl kustomize (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Declarative Management of Kubernetes Objects Using Kustomize; kubernetes/website (GitHub), kubectl kustomize (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors.
Cite this
iinventedlight. 2026. "Kustomize customizes Kubernetes manifests with generators, patches, bases and overlays." iinventedlight Library, iil:note:1p7e9m47, version of 2026-11-18. https://iinventedlight.com/library/notes/kubernetes-kustomize/. License: CC-BY-4.0.
@misc{iil_note_1p7e9m47,
author = {{iinventedlight}},
title = {{Kustomize customizes Kubernetes manifests with generators, patches, bases and overlays}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/kubernetes-kustomize/},
note = {Permanent ID iil:note:1p7e9m47. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/kubernetes-kustomize.md.