hokusai staging|production update --dry-run to perform both:
kubectl apply -f <spec> --dry-run=client
kubectl apply -f <spec> --dry-run=server
Do not perform kubectrl apply -f <spec> --dry-run (w/o specifying client/server) anymore as that is deprecated.
Server-side dry-run catches more things such as invalid port name which client side dry-run does not catch.
jian@artsy:~/tmp$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.10", GitCommit:"62876fc6d93e891aa7fbe19771e6a6c03773b0f7", GitTreeState:"clean", BuildDate:"2020-10-15T01:52:24Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.10", GitCommit:"62876fc6d93e891aa7fbe19771e6a6c03773b0f7", GitTreeState:"clean", BuildDate:"2020-10-15T01:43:56Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
jian@artsy:~/tmp$
jian@artsy:~/tmp$ kubectl apply -f test.yml --dry-run
W0921 15:57:10.758093 17112 helpers.go:535] --dry-run is deprecated and can be replaced with --dry-run=client.
deployment.apps/jian-test created (dry run)
jian@artsy:~/tmp$ kubectl apply -f test.yml --dry-run=client
deployment.apps/jian-test created (dry run)
jian@artsy:~/tmp$ kubectl apply -f test.yml --dry-run=server
The Deployment "jian-test" is invalid: spec.template.spec.containers[0].ports[0].name: Invalid value: "jian-test-to-many-chars-http": must be no more than 15 characters
Reference:
https://kubernetes.io/blog/2019/01/14/apiserver-dry-run-and-kubectl-diff/
hokusai staging|production update --dry-runto perform both:kubectl apply -f <spec> --dry-run=clientkubectl apply -f <spec> --dry-run=serverDo not perform
kubectrl apply -f <spec> --dry-run(w/o specifying client/server) anymore as that is deprecated.Server-side dry-run catches more things such as invalid port name which client side dry-run does not catch.
Reference:
https://kubernetes.io/blog/2019/01/14/apiserver-dry-run-and-kubectl-diff/