Kustomize Explained: Template-Free Kubernetes Configuration

Manage Kubernetes manifests per environment with Kustomize: bases and overlays, patches, generators, images and how it compares to Helm.

Published December 2, 2026

Kustomize takes a different approach from Helm: instead of templates with placeholders, you keep plain, valid Kubernetes YAML and describe environment-specific changes as overlays and patches. It is built into kubectl, works naturally with GitOps tools, and keeps manifests readable.

The concept

A kustomization.yaml lists resources (YAML files) and transformations: common labels, name prefixes, namespace, image tag overrides, and patches. A base holds the shared manifests; overlays (dev, staging, prod) reference the base and apply their own changes, such as more replicas, different resources or extra objects.

Generators create ConfigMaps and Secrets from files or literals and append a content hash to their names; because the Deployment reference is updated to the new name, changing config automatically triggers a rollout. Running kubectl kustomize (or kustomize build) prints the final manifests, which is easy to review in pull requests.

Typical layout

k8s/base/overlays/deployment.yamlservice.yamldev/prod/
A base with environment overlays.

How it works

referenced byrenderoutputbaseplain YAMLoverlay prodpatches, imageskustomize buildFinal manifestsapply / GitOps
Overlays transform the base without templates.

Kustomize vs Helm

KustomizeHelm
ApproachPatches over plain YAMLGo templates + values
Built into kubectlYes (kubectl -k)No (separate CLI)
Packaging / distributionNot its focusCharts, repositories, versions
Release history / rollbackVia git / GitOpsBuilt-in releases
Best forYour own apps across environmentsDistributable, configurable packages

Practical examples

Base kustomization

Shared across environments.

# k8s/base/kustomization.yaml
resources: [deployment.yaml, service.yaml]
labels:
  - pairs: { app: api }
configMapGenerator:
  - name: api-config
    literals: [LOG_LEVEL=info]

Production overlay

More replicas, pinned image, a patch.

# k8s/overlays/prod/kustomization.yaml
resources: [../../base]
namespace: prod
images:
  - name: example/api
    newTag: "2.3.1"
patches:
  - target: { kind: Deployment, name: api }
    patch: |-
      - op: replace
        path: /spec/replicas
        value: 4

Render and apply

Review the output in CI before applying.

kubectl kustomize k8s/overlays/prod | less
kubectl apply -k k8s/overlays/prod

Common mistakes

  • Deeply nested overlays that are hard to follow.
  • Copy-pasting whole files into overlays instead of small patches.
  • Forgetting generated ConfigMap names change (reference them through Kustomize, not by hard-coded name).
  • Mixing kubectl edit changes with Kustomize-managed resources.

Key takeaways

  • Kustomize patches plain YAML: no templates.
  • Bases hold shared config; overlays hold per-environment changes.
  • Generators hash ConfigMaps so config changes roll out.
  • Render output and review it before applying.

FAQ

Can Kustomize use Helm charts?

Yes, it can inflate Helm charts as a resource, though many teams let their GitOps tool handle Helm directly.

Is kustomize in kubectl the latest version?

kubectl embeds a Kustomize version that may lag the standalone CLI; use the standalone binary for newer features.

How do I manage secrets?

Use secretGenerator with SOPS-encrypted files or external secret managers instead of plain secret files in git.

More DevOps articles