Confusion is Passing commands and arguments

Question :
Create a Kubernetes Pod named ckad16-memory-aecs, with a container named ckad16-memory-ctr-aecs running the polinux/stress image, and configure it to use the following specifications:

  • Command: stress
  • Arguments: ["--vm", "1", "--vm-bytes", "15M", "--vm-hang", "1"]
  • Requested memory: 10Mi
  • Memory limit: 20Mi

For this, I created it as shown in the attached screenshot. The pod is running also looks like the logs are correct.

But the proposed solution shows
command: [“stress”]
args: [“–vm”, “1”, “–vm-bytes”, “15M”, “–vm-hang”, “1”]

I understand that this is the ideal way. But is my solution also correct. ?

I am very comfortable with the below approach and works for me most of the time. Is it okay to use this?
command : [“/bin/sh”, “-c”, "command and argument "]

Whilst

command: [ "/bin/sh", "-c", "stress --vm 1 --vm-bytes 15M --vm-hang 1"]

will run, it is not what the question is asking for, In this case the marking script isn’t just checking that the pod runs correctly, it will also examine the running pod manifest to ensure you created the command in the manner requested.

You have been explicitly asked to put stress as command: and its arguments as args: so that is what you must do.

Thanks [Alistair_KodeKloud] !

Just curious to know, In such cases , If few things are missing. There will not be any score for that answer or some score is given :slightly_smiling_face:

It depends on the marking policy. Cannot say how the exam would mark such a question, but it does give partial scores.
For for instance it was 1 for the command, 1 for the arg and 1 for the pod running, then you would get 1/3
Nobody other than Linux foundation know exactly how the exam score is calculated, so our labs won’t mark the same way.