Posts

Showing posts with the label imperative

KB:Kubernetes --dry-run Client vs Server

 The main difference between the two is where the simulation occurs: With --dry-run= client , the simulation happens locally on the client machine before the request is sent to the server. With --dry-run= server , the simulation happens on the server side after the request is sent to the API server. In practice, --dry-run=client is often faster because it doesn't involve communication with the server, but --dry-run=server can provide a more accurate simulation of how the server will handle the request.

KB:Kubernetes run imperative Busybox pod and connect

#buysbox kubectl run -it --rm busybox01 --image=busybox --restart=Never --command -- sh #Network Tools kubectl run -it --rm netshoot --image=nicolaka/netshoot --restart=Never --command -- bash note, busybox image uses "sh" shell, /bin/bash will not work! by design busybox will exit, there is no process/cmd that will run, so you have to connect to the pod/container during run time by overriding the command arg.  kubectl run : This is the command used to create and run a new Pod. -it : This flag is a combination of -i and -t . -i stands for "interactive", which keeps the stdin open even if not attached, and -t stands for "tty", which allocates a TTY (terminal). --rm : This flag tells Kubernetes to automatically remove the Pod once it has finished executing. busybox01 : This is the name of the Pod being created. --image=busybox : This specifies the Docker image to use for the Pod. In this case, it is the busybox image, which is a lightweight Linux distrib...