Hi, while trying to create static pod in the manifests/ folder, The pod gets cre . . .

Deepak Mourya:
Hi, while trying to create static pod in the manifests/ folder, The pod gets created instead of getting yaml file
root@controlplane:/etc/kubernetes/manifests# kubectl run --restart=Never static-busybox --image=busybox --command – sleep 1000 --dry-run -o yaml > static-busybox.yaml
root@controlplane:/etc/kubernetes/manifests# cat static-busybox.yaml
pod/static-busybox created
root@controlplane:/etc/kubernetes/manifests#

Peter Lee:
Hi @Deepak Mourya yes. it makes sense. is this question or statement? sorry. i missed that it was a Q. yes. =client would do it…

Tej_Singh_Rana:
add --dry-run=client -oyaml before double dash(–). It assumes that you’re executing all commands/args inside the container.

Deepak Mourya:
@Tej_Singh_Rana Ok let me try

Deepak Mourya:
Yes it works. Thanks :slightly_smiling_face:

Gennway:
@Deepak Mourya whenever I make dry client with yaml, I put --command argument and the end of the whole kubectl command

Deepak Mourya:
So I was doing a mistake by using the dry-run after – command so it was taking this as another command like sleep

Peter Lee:
tip: try to set up like this “export do=“-o yaml --dry-run=client” and then do this before — command.