CKAD Mock Exam #1

For this question, please set the context to cluster3 by running:

kubectl config use-context cluster3

The deployment called foundary-apd inside the blue-apd namespace on cluster3 has undergone several, routine, rolling updates and rollbacks.

Inspect the revision 3 of this deployment and store the image name that was used in this revision in the /root/records/foundry-revision-book.txt file on the student-node.

Is there a particular way we’re supposed to be able to write to the file? I keep getting errors saying “records/foundry-revision-book.txt” E212: Can’t open file for writing

My answer for context: kubectl rollout undo deployment/foundary-apd -n blue-apd --to-revision=3 --dry-run=client -o yaml | grep ‘image:’ | awk ‘{print $2}’ > /root/records/foundry-revision-book.txt

Also is there somewhere we can review solutions to the questions in the mock exams?

Let’s start from the end of the question: when you choose “End Exam”, you’ll get a list of the problems you missed, along with a solution of the problem.

As to the problem itself: I believe the problem wants you to write the file on to the student node’s root directory. I don’t know if the “records” directory already exists – you’d get that error if it did not already exist – but you can certainly create the directory.