kustomize - template-free customization of Kubernetes YAML (v5.7)
kustomize build DIR | kustomize edit set image|namespace|replicas ... | kustomize edit add resource F
Options you will use
build DIR- Render a kustomization (same as kubectl kustomize DIR).
edit set image NAME=NEWNAME:TAG | NAME:TAG | NAME@DIGEST- Set the images: entry in ./kustomization.yaml - the one-line change a GitOps pipeline commits.
edit set namespace NS / edit set replicas NAME=N / edit add resource FILE- Other edits of ./kustomization.yaml.
Examples
$ cd overlays/dev && kustomize edit set image registry.lab/pay/payments-api@sha256:...Pin dev to the digest CI pushed.
Gotchas
- configMapGenerator/secretGenerator names get a content hash; references are rewritten, so a config change rolls the pods.
- edit rewrites the file in kustomize's own format (comments are lost).
Try kustomize in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.