Gennway:
and if the exam says that I have to run specific image with command “sleep 4800” is it okey if I just run kubectl run example --image=example --command -- sleep 4800 and it would create
- command:
- sleep
- "4800"
or I have to split it into command + arg?
command: ["sleep"]
args: ["4800"]
Shankar PS:
kubectl run example --image example --command sleep 4800
Shankar PS:
This command works
Gennway:
I know that it works, but argument --command creates just “command” in yaml, without args, and im wondering if its fine on exam if I run commands in this way, without args (like in an example you sent)
Shankar PS:
command is fine
Peter Lee:
yes. it will do that same thing on the exam. but keep in mind that command and args are meant to be different. command is equivalent to entrypoint in the dockerfile and args is to CMD. they are slightly different purpose but again both work on the exam.
Aditya Pratap Bhuyan:
This is fail safe
kubectl run podname --image=image --command -- sh -c "sleep 4800"