Possible to do a "dry run" validation of files?
This works for me (kubernetes 1.7 and 1.9):
kubectl apply --validate=true --dry-run=client --filename=file.yaml
Some kubectl commands support a --dry-run
flag (like kubectl run, kubectl expose, and kubectl rolling-update).
There is an issue open to add the --dry-run
flag to more commands.
There is a tool called kubeval which validates configs against the expected schema, and does not require connection to a cluster to operate, making it a good choice for applications such as CI.