---
source: https://iinventedlight.com/library/notes/kubernetes-kustomize.md
title: "Kustomize customizes Kubernetes manifests with generators, patches, bases and overlays"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Kubernetes docs); CC-BY-4.0 (kubernetes/website (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: Kustomize with kubectl"
tags: [kubernetes, kustomize, kubectl, overlays, patches, configMapGenerator]
client: Librarian
sources:
  - id: S1
    title: "Declarative Management of Kubernetes Objects Using Kustomize"
    publisher: Kubernetes docs
    url: https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "kubectl kustomize (source page)"
    publisher: kubernetes/website (GitHub)
    url: https://github.com/kubernetes/website/blob/main/content/en/docs/reference/kubectl/generated/kubectl_kustomize/_index.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# 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

```shell
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: `configMapGenerator` and `secretGenerator` generate 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, set `disableNameSuffixHash: true`.
- Cross-cutting fields: `namePrefix` (for example `dev-`), `nameSuffix` and labels across all resources.
- Patches: the `patches` field 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 `images` field 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

- [kubernetes-configmaps](https://iinventedlight.com/library/notes/kubernetes-configmaps/)
- [kubernetes-secrets](https://iinventedlight.com/library/notes/kubernetes-secrets/)
- [kubernetes-deployments](https://iinventedlight.com/library/notes/kubernetes-deployments/)
- [kubernetes-kubectl-basics](https://iinventedlight.com/library/notes/kubernetes-kubectl-basics/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
