You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kubeconform only validates manifests using the OpenAPI specifications.
There are some additional server-side validations that are not part of the OpenAPI specifications and are performed by the Kubernetes controllers. Those server-side validations are not covered by Kubeconform (examples: #65, #122, #142). You can use a 3rd-party tool or the kubectl --dry-run=server command to fill the missing gap.
Hi @nosleep77 , as @eyarz mentionned - Kubeconform does "dumb" validation using JSON schema. Controllers might have additional server-side logic not reflected in their OpenAPI/JsonSchema spec.
I generated a simple deployment file
kubectl create deploy nginx --image nginx -o yaml
I then tinker with this section
spec: containers: - image: nginx name: nginx
spec: containers: - image: nginx name: nginx
I move containers to spec level as seen above.
kubeconform says no issues
$ kubeconform deployment/deploy-nginx.yaml ; echo $? 0
dry-run=server says there is a problem
$ k apply -f deployment/deploy-nginx.yaml --dry-run=server The Deployment "nginx" is invalid: spec.template.spec.containers: Required value
The text was updated successfully, but these errors were encountered: