Skip to main content
A kustomization.yaml file, like any other Kubernetes manifest, can include the apiVersion and kind fields. These fields are optional because Kustomize and kubectl will infer sensible defaults when they are omitted, but explicitly declaring them improves clarity, portability, and compatibility across different Kustomize or kubectl versions. Example — typical minimal kustomization.yaml:
Why you should set these fields
  • apiVersion: Identifies the Kustomize API schema used to interpret the file. Kustomize evolves over time; different releases may add fields or change behavior. Explicitly setting apiVersion ensures the file is validated and processed using the intended schema.
  • kind: For kustomization files, this value is always Kustomization. Including it removes any ambiguity when tooling inspects the manifest.
Table — quick reference When to include or update apiVersion
  • Include apiVersion for robust, version-stable manifests that work across different environments and CI/CD pipelines.
  • If you upgrade Kustomize (or your kubectl version that bundles Kustomize) and the new release introduces a new API (for example v1), update apiVersion in your kustomization files as part of the upgrade process.
  • If you get errors about unknown fields or unsupported API, confirm the Kustomize version you are using and match the apiVersion accordingly.
Example — minimal kustomization (repeated for clarity):
Always match apiVersion to the Kustomize/library version your tooling expects (for example, kustomize.config.k8s.io/v1beta1 or later). When upgrading Kustomize, verify whether the release introduces a new API (v1, etc.) and update your kustomization.yaml files to maintain compatibility.
Common commands
  • Render resources locally using the Kustomize CLI:
  • Apply a kustomization directory with kubectl:
If you see errors such as “unknown field” or “unsupported apiVersion”, check the Kustomize version bundled with your kubectl or the standalone Kustomize binary. Update the apiVersion in your kustomization.yaml or align tooling versions to resolve schema mismatches.
Links and references If you need an example of upgrading apiVersion between Kustomize releases or help detecting the Kustomize version in your environment, I can provide step-by-step guidance.

Watch Video