Hi All, I hope all of you are well. I have a question regarding using the --dr . . .

Ray Layadi:
Hi All,

I hope all of you are well.

I have a question regarding using the --dry-run flag. The followings are from k8s documentation

Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.

It seems that if we use --dry-run=client, it does NOT perform validation of the yaml file since it’s NOT passed to the API server. However, if we use --dry-run=server, it performs validation of the yaml file. My question is, from the doc, it says that it does NOT persist the resource, just to clarify that it does NOT create the actual object right? Even though we submit the request to api-server? In that case, I guess it would be better to use --dry-run=server since you also get validation?

Mike K:
It will take longer if you do --dry-run=server in the exam. The intent of using --dry-run=client in the exam is to mimic the old behavior of the --dry-run flag, which was to output the object that would be sent to the server. You’ll want to use the server strategy when you are doing something on a production cluster. Read this to understand the motivation behind the newer dry-run options - https://kubernetes.io/blog/2019/01/14/apiserver-dry-run-and-kubectl-diff/

Ray Layadi:
Hi Mike,

Thank you very much for the explanation!

aydemirkala:
what is the server is it worker node or master node?