kustomization.yaml file can include the apiVersion and kind fields. While Kustomize will infer sensible defaults when those fields are omitted, declaring them explicitly is a best practice. Explicit fields make your intent clear and reduce the chance of breakage when different Kustomize or kubectl versions are used.
Always specify
apiVersion and kind in kustomization.yaml so your manifests remain explicit and portable across environments and Kustomize versions.Common apiVersion / kind values
Which one to use depends on the Kustomize implementation and release you are targeting. Newer Kustomize versions provide the
v1 group/version; older releases and some kubectl-bundled versions may default to v1beta1.
Example kustomization.yaml (explicit)
- Sharing overlays or bases across teams and clusters.
- Pinning manifests to a known Kustomize behavior.
- Ensuring compatibility when switching between the standalone
kustomizebinary and thekubectl kustomize/kubectl apply -kbuilt-in support.
Checking your Kustomize implementation
- Standalone Kustomize binary:
- If you rely on
kubectl’s embedded Kustomize:
kubectl release notes to understand which Kustomize API versions it supports.
Compatibility guidance
- Match the
apiVersionin yourkustomization.yamlto a version supported by your target Kustomize implementation. - If you use
kubectl apply -korkubectl kustomize, verify that yourkubectlsupports the Kustomize API version used in your manifest. - When upgrading Kustomize or
kubectl, test overlays in a staging environment to detect any behavior changes betweenv1beta1andv1.