Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server-side dry-run to staging/production update #268

Open
artsyjian opened this issue Sep 21, 2021 · 0 comments
Open

Add server-side dry-run to staging/production update #268

artsyjian opened this issue Sep 21, 2021 · 0 comments
Labels
medium medium importance

Comments

@artsyjian
Copy link
Contributor

artsyjian commented Sep 21, 2021

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium medium importance
Projects
None yet
Development

No branches or pull requests

1 participant