Dear All, I am trying to create a pod via imperative command (the idea is to run . . .

Vagif Gafar:
Dear All,
I am trying to create a pod via imperative command (the idea is to run with sh interpreter, the following command and arguments: sh -c sleep 1000). However, all of the below options are failing:

kubectl run mybusy --image=busybox --restart=Never --command '/bin/sh -c sleep 1000'
kubectl run mybusy --image=busybox --restart=Never --command 'sh' -- '-c sleep 1000'
kubectl run mybusy --image=busybox --restart=Never --command 'sh' -- '-c' 'sleep' '1000' --dry-run=client -o yaml

Only this option works fine, but it is not exactly what I want

kubectl run mybusy --image=busybox --restart=Never --command sleep 1000 

Hinodeya:

kubectl run mybusy --image=busybox --restart=Never -- /bin/sh -c sleep 1000 

Hinodeya:

kubectl run mybusy --image=busybox --restart=Never --dry-run=client -o yaml -- /bin/sh -c sleep 1000 > mybusy.yaml for generated dump if you want

Basavraj Nilkanthe:
Even you don’t need to call shell explicitly in busybox container… You can simply run command like – sleep 1000

Vagif Gafar:
I know this, Basav

Vagif Gafar:
@Hinodeya your 1st command does not work, tried

jumble:
If you supply only args for a Container, the default Entrypoint defined in the Docker image is run with the args that you supplied