🎨
Container Platform

Kustomize

Customize Kubernetes YAML without templates or Helm

🐧 Linux🍎 Mac🪟 Windows
Reviewed: Tested on: Kubernetes 1.29 · Terraform 1.8 · Ubuntu 22.04

If you're on Kubernetes 1.27 or older

  • Ingress: networking.k8s.io/v1 is required — v1beta1 removed in 1.22+
  • Pod Security: PodSecurityPolicy removed in 1.25 — use Pod Security Admission (PSA) labels
  • HPA v2 autoscaling/v2 is stable — check API version in manifests

If you're on Kubernetes 1.28

  • Sidecar containers (1.29+) change init-container ordering — review sidecar docs before upgrade
  • Verify metrics-server and HPA after control plane bump

What is this?

Kustomize patches Kubernetes YAML with overlays — no templating language required.

📁

Config files for Kustomize

Where to create or edit the main configuration — paths below match the setup steps.

  • kustomization.yaml

    Location: Base or overlay directory

    Resources, patches, and image tags

  • overlays/prod/

    Location: Repo — environment-specific overlay

    Production patches without templating

📥

Step 01

Install Kustomize

(01)Install Kustomize

Linux
1curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
2sudo mv kustomize /usr/local/bin/
⚙️

Step 02

Configure Kustomize

(01)Configure Kustomize

Linux
1kubectl kustomize overlays/prod
2kubectl apply -k overlays/prod

Step 03

Verify

(01)Verify installation

Linux
1kustomize version
2kubectl kustomize .