Skip to content

Strict decoding error: unknown field

kubectl apply validates fields on the server and rejects ones the schema doesn’t contain.

The message gives the full path to the field. Compare it with the schema:

Terminal window
kubectl explain deployment.spec.template.spec.containers --recursive | less
kubectl explain deployment.spec.template.spec.containers.resources
Cause Example
Typo resource instead of resources
Wrong indentation resources at the pod level instead of inside a container
Field from a newer Kubernetes version A field your cluster’s version doesn’t serve yet
CRD version mismatch The manifest targets a newer version of an operator’s CRD than is installed

Correct the field. Catch these before they reach the cluster by running kubectl apply --dry-run=server -f <file> in CI against a cluster of the same version, or a schema validator such as kubeconform with the matching Kubernetes version.