Ex 5 of Lab: CKA Mock Exam 5

Hello, I got the deploy and pods running, but the exercise was marked as not passed.
I checked the solution and there is a tiny difference in how the config map is passed to the env variable.
I used env + configMapKeyRef, while the solution provided uses envFrom + configMapRef. I do not think my solution is wrong.

Thanks

If I recall – I also need to Mock Exam number to actually recheck this – the wording of the question indicates that you want to expose only the one key to the pod, which requires the env.valueFrom syntax instead of the envFrom syntax you’re using. The point of the question IIRC is to demonstrate this distinction.

Hello Rob, in the exercise description I do not see any detail about using envFrom.

If that is what you want, then it must be specified, otherwise my solution should be accepted.
All the other exercises in the mock exams and in the kk engineer always specify NOT TO use envFrom, but the env + configMapKeyRef, so I used the same here.

Thanks.

Remember this is an exam prep course – one thing you should NOT assume is that these exams are fair :slight_smile: They can be. But you should not assume that. Reading the question carefully and making.a choice is what you need to do. But the questions can be opinionated, and your choice may not be correct as far as the grader goes. This is true in the actual exam, I can promise you, from experience.

Ok, so you are saying that even a correct and working solution can be rejected for no real reason and Kodekloud approves and applies the same behavior. Great news.

I am saying that what constitutes a correct solution can be a matter of opinion; your opinion may not be the opinion of the person that designed the question. That’s not good news or bad news. That’s life.

Hello Rob, I did the exercise again, and even though I now add the configmap exactly as KK wants (envfrom), and the deploy and pods are up and running, it is still marked in red.
It says the cm is not created :joy:
Below the screenshots of my config and of the cluster:



I really do not understand such evaluations. Finally I am done with the KK mock tests and I won’t have to deal anymore with such annoying things.
Regards

Hi @Mundofik

I am not sure what’s wrong with your config. I verified it with the same config using envFrom and the task validates to a pass.

Also please note, the second point in the instruction specifically mentions to use the newly created configMap name. Hence, we use envFrom.

2. Update the deployment to make use of the newly created configMap name.

I created that configmap, there is nothing existing in the cluster for that exercise, I do not understand what you are pointing out to.
If it works for you, then the labs are not consistent or the exercise solution checks for something else, that is not specified in the description.