I am preparing for the CKAD exam and I am doing practice with the questions provide here
I have a doubt over this two different way of executing commands. Here the example provided is with a job but I think the question might be more general and extendable to all containers.
Under the job exercises there are two requests:
kubectl create job pi --image=perl -- perl -Mbignum=bpi -wle 'print bpi(2000)'
Create a job with the image busybox that executes the command 'echo hello;sleep 30;echo world
kubectl create job busybox --image=busybox -- /bin/sh -c 'echo hello;sleep 30;echo world'
Why in the second command I need to provide /bin/sh -c as well?
How could I understand when to use it and when not?