There seems to be a ‘literal’ way of checking the solutions in the labs. Task: I . . .

Miroslav Beres:
There seems to be a ‘literal’ way of checking the solutions in the labs.
Task: In the ckad-multi-containers namespace, create a pod named healthy-server, which consists of 2 containers.
SECTION: APPLICATION DESIGN AND BUILD

For example:
not correct:
- command:
- sh
- -c
- echo Initialize application environment!
- sleep 10
correct:
- command:
- sh
- -c
- echo Initialize application environment! && sleep 10

It seems to me, we are unnecesarily making this journey more difficult as it already is. Unless there is really an instruction to make it using &&, which i don’t think there is:
“Init container should print this message Initialize application environment! and then sleep for 10 seconds.”

Miroslav Beres:
next one:
blue / green deployments, 30% should go to green, i don’t know the exact area, but it should not matter:
Instruction:
“Use the correct service type to access the application from outside the cluster and application should listen on port 8080.”
In my opinion, to make the application accessible from outside the cluster, LoadBalancer is the first option, NodePort the second.
But, only the NodePort is considered to be the correct solution.
If the script only goes after the ‘syntax’ and if it does not try to access the app from outside, LoadBalancer should be also considered to be a correct service type.

Alistair Mackay:
For the first one, the syntax you have stated is not correct is just that - not correct.

    - command:
      - sh
      - -c
      - echo Initialize application environment!
      - sleep 10

command will only form one command for the underlying operating system. What the above will pass to the operating system is this:

sh -c "echo Initialize application environment!" sleep 10

…which if you paste onto a Linux command prompt is invalid usage of the sh command

The second version will create this

sh -c "echo Initialize application environment! && sleep 10"

which is valid syntax

Alistair Mackay:
For the second one

LoadBalancer services may only be used if the cluster supports them. Support for LoadBalancer services is an add-on to any cluster. These add-ons come usually from cloud providers, e.g. AWS Application Load Balancer. The provisioning of load balancers is not done by Kubernetes itself.

For the purpose of labs, and exam questions, use NodePort unless the question explicitly tells you to use LoadBalamcer .

If the cluster has no load balancer add-on, then the service will get no EXTERNAL IP and will be unusable. This also means that the marker script will not be able to connect to the service, therefore the question will be marked incorrect.

Miroslav Beres:
Thank you, @Alistair Mackay , this really helps to understand what went wrong - and to get prepared for the exam. I appreciate it very much.