ConfigsApr 14, 2026·3 min read

Kustomize — Template-Free Kubernetes Manifest Customization

Kustomize lets you customize Kubernetes manifests through overlays and patches without templates. Maintained by SIG CLI and built into kubectl, it is the declarative way to manage environment-specific YAML across dev/staging/prod.

TL;DR
Kustomize customizes Kubernetes YAML through overlays and patches without templating, built directly into kubectl.
§01

What it is

Kustomize lets you customize Kubernetes manifests through overlays and patches without using templates. Maintained by SIG CLI and built into kubectl since version 1.14, it provides a declarative way to manage environment-specific YAML across dev, staging, and production. You keep a base set of manifests and layer environment-specific modifications on top.

Kustomize targets platform engineers, SREs, and DevOps teams who manage Kubernetes deployments across multiple environments and want to avoid the complexity of Helm's templating language.

§02

How it saves time or tokens

Kustomize eliminates template syntax from your Kubernetes manifests. Your base YAML is valid Kubernetes YAML at all times, making it readable and testable without rendering. Overlays compose cleanly: you add patches, change image tags, or modify resource limits per environment without duplicating entire manifests. Since it is built into kubectl, there is no extra binary to install or maintain.

§03

How to use

  1. Create a base directory with your Kubernetes manifests:
# base/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-server
spec:
  replicas: 1
  template:
    spec:
      containers:
      - name: api
        image: myapp:latest
        resources:
          limits:
            memory: 256Mi
  1. Create a kustomization.yaml for the base:
# base/kustomization.yaml
resources:
- deployment.yaml
- service.yaml
  1. Create an overlay for production:
# overlays/production/kustomization.yaml
resources:
- ../../base
patches:
- patch: |-
    - op: replace
      path: /spec/replicas
      value: 3
  target:
    kind: Deployment
    name: api-server
images:
- name: myapp
  newTag: v2.1.0
  1. Apply with kubectl:
kubectl apply -k ./overlays/production
§04

Example

Preview the rendered output before applying:

kubectl kustomize ./overlays/production
# or standalone
kustomize build ./overlays/production
§05

Related on TokRepo

§06

Common pitfalls

  • Deeply nested overlay structures become hard to reason about. Keep the overlay hierarchy to two levels (base + environment) for maintainability.
  • Strategic merge patches silently ignore unknown fields. Validate your patches against the actual resource schema to catch errors early.
  • Forgetting to list resources in kustomization.yaml means they are silently excluded from the build output.

Frequently Asked Questions

How is Kustomize different from Helm?+

Helm uses Go templates to generate Kubernetes YAML, requiring a templating language and a values file. Kustomize uses plain YAML with overlays and patches. Kustomize is simpler for environment-specific customization; Helm is more powerful for packaging and distributing charts.

Is Kustomize built into kubectl?+

Yes. Since kubectl 1.14, you can use kubectl apply -k and kubectl kustomize natively without installing a separate binary. The standalone kustomize binary offers newer features that may not be in your kubectl version.

Can I use Kustomize with Helm charts?+

Yes. You can use Kustomize's helmCharts field to render Helm charts as part of a Kustomize build. This lets you apply Kustomize patches on top of Helm-rendered output.

Does Kustomize support secrets and configmaps?+

Yes. Kustomize can generate ConfigMaps and Secrets from files or literals using configMapGenerator and secretGenerator. It appends content hashes to names for automatic rollout on changes.

How do I manage multiple environments?+

Create separate overlay directories for each environment (dev, staging, production). Each overlay references the same base and applies environment-specific patches. Use kubectl apply -k ./overlays/production to deploy.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets