Hi all,
Been taking the Ultimate Mock Exam stuff in preparation for the CKA and I have a few questions about some of the tasks in the mocks:
The first one is that I was required to install ETCDCTL utility in order to create and restore ETCD snapshots. However, I cant find any guidance on the steps to install ETCDCTL from the kubernetes.io documentation, which AFAIK is the only resource allowed in the actual CKA. Steps to install etcdctl are in the etcd.io site, but we arent allowed to access that site in the CKA are we?
If not, how are we supposed to be able to install etcdctl in the actual CKA? Its not realistically something to memorise…
Secondly, the mock exams seem to marking me as failing some questions when it comes to outputting data to text files in the student node. The two examples I have is a question asking me to output the rollout revision 2 image used (kodekloud/webapp-color) I did it by searching for the rollout revision numbers image and simply doing ‘echo kodekloud/webapp-color > /file/needed.txt’ This was marked as incorrect. The slution provided at the end of the exam was:
‘echo “kodekloud/webapp-color” > /file/needed.txt’ with quotations around the text to be put into the text file. I tested this in a 2nd version of the file and compared the 2. They were identical, yet my solution was marked as incorrect?
Exactly the same happened in another question around the node with the highest cpu usage across all clusters. I found the solution, edited the file via vim and entered the answer (cluster3,cluster3-controlplane). This was marked as incorrect. The official solution creates a file with identical data in it (cluster3,cluster3-controlplane) So why was my answer incorrect?
Is the CKA really as banal as to require specific commands to store data? I would have thought that so long as you can locate the answer it shouldnt matter how you get it, whether linux shell commands, kubectl commands, json or any other method?
Getting those answers wrong is starting to erode any confidence in the CKA if its going to be that pedantic and is asking questions I simply cant memorise (etcdctl install) or dont go about it the specific way the exam is programmed to assess it…
- The etcdctl install is so you know how to do it, but this won’t appear on the exam, since, as you correctly surmised, the needed docs aren’t on the allowed materials list.
- Since the grader needs some way to get at your data, putting answers into text files is common both in our mock exams and in the real exam as well. I’m not sure that quoting is the problem here – if you look at how the shell and the echo command handle quoting, the quote marks don’t go into the output. More likely the grader wants the answers formatted in some way (comma separated? space separated?) that you didn’t use in the answer, and it got annoyed about it.
- The highest CPU problem is a bit notorious, since in some versions, you’re graded on the output as of the end of the exam, rather than the state of the cluster when you do the question. We’ve tried to weed these questions out, since that’s ridiculous. I used the Ultimate Mocks myself when I last renewed my CKA, and started putting the output command into a file, and rerunning it just before I clicked on End Exam.
As to the “banality of the exam” – yeah, common tactic for automatically graded exams, including the real one. Figuring out what you actually wrote in the terminal is hard and required tricks. Reading a file with output is much easier to code in a grader script. But it’s not as bad as all that – mostly the practical exams like CKA are handled fairly reasonably.
In response to your reply around my 2nd questions, I retried the mock exam and managed to get the same question.
I tried 3 ways of putting the text “cluster3,cluster3-controlplane” in the required text file, the answer had to have a single comma after the cluster name with no space after the comma then the node name. I tried:
- echo cluster3,cluster3-controlplane > /opt/filename.txt
- echo “cluster3,cluster3-controlplane” > /opt/filename.txt
- vim /opt/filename.txt and inserting cluster3,cluster3-controlplane before write quitting
Of the three approaches, all seemed to have identical text when I used cat on the file, but only the second one, which was the command provided by the solution, was recorded as correct by the assessor.
I was wondering if the other commands are leaving hidden characters, like a crlf or other characters before/after the text being entered, and if the grader is picking them up as not part of its required result and therefore grading it as incorrect? If so, is there any advice around the best way to output things like commands, results of commands into the required files? Echo with quotation marks around the text to be echoed, using vim to edit the file after echoing and checking for errors etc?
I find the separated by just a comma seems to be the most common. Usually the grader expects (or at least accepts) a trailing line feed (\n), since that’s what echo by default does. The only time you care about that line feed is if you need to encode echo’s output with base64; in that case, you’ll typically run it as
echo -n my,text,here | base64
which will prevent the trailing \n from getting mixed up in the encoded text.