CKAD Certification Exam Preparation Guide and Tips

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. The CNCF/Linux Foundation offers this performance-based exam which targets the developer aspect of Kubernetes skills such as deploying apps, configuring apps, rolling out the application, creating persistent volumes, etc.


CKAD (Certified Kubernetes Application Developer) is designed for software developers who would like to develop and deploy their containerized applications in Kubernetes.

The curriculum includes the following general domains with the associated weights:
Core Concepts – 13%
Configuration – 18%
Multi-Container Pods – 10%
Observability – 18%
Pod Design – 20%
Services & Networking – 13%
State Persistence – 8%

-------------------------------------------------------------------------

After my successful achievement of CKAD Certification, I would love to share my experience and tips to clear the exam.

I have practiced a lot on kubectl commands and used kubernetes.io/docs documentation, this should be your first priority. If anyone wants to understand the concepts and go through in deep or those who needs to start from scratch, can refer Udemy course https://www.udemy.com/course/certified-kubernetes-application-developer

Exam

  • 2 hours duration, comprised of 19 questions
  • Passing score is 66%
  • Remotely proctored
  • Kubernetes version 1.19
  • Four Clusters (switch between clusters to perform questions)
  • Notepad
  • You can open only one tab to browse Kubernetes documentation (http://kubernertes.io/docs)
  • Before the exam, we are required to clear our desk and ensure that there is no one in the room. During the exam, we must keep the webcam on and share all the screens.
  • Ctrl+C & and Ctrl+V are not supported in your exam terminal. To copy and paste text, please use, For Linux: select text for copy and paste with right click. For Windows: Ctrl+Insert to copy and Shift+Insert to paste. For Mac: ⌘+C to copy and ⌘+V to paste.
  • Root privileges can be obtained if required by running 'sudo −i'.

Tips

  • Learn to use kubectl commands instead of creating YAML files from scratch wherever possible to save time.
  • Make aliases of common commands to speed up
  • Set kubectl command autocompletion: 
    • source <(kubectl completion bash) 
    • echo "source <(kubectl completion bash)" >> ~/.bashrc
  • Use -h to quickly get help. For example, kubectl run -h .
  • For debugging, use kubectl get all --all-namespaces to quickly find the broken resources.
  • Use the search function of https://kubernetes.io/docs to quickly find the pages you need.
  • Don’t spend too much time on one question. Skip the questions with weight 2%-3% if they take a long time. Flag and do them later when you have time.
  • Try to attempt starting questions from 1-5 as being short questions, it will give you confidence for the rest of the questions to solve.
  • Try to attempt every question from 11-19 as it will be of more weightage.
  • In each question, you will be asked to switch your context to appropriate cluster. Some people forget this step, especially when they are running out of time. So, keep that in mind!
  • Some questions will be like, to create Kubernetes resources in specific namespace. Pay extra attention to avoid falling into this mistake (use the -n <namespace-name>).
  • You can use the below commands to generate the YAML files/manifests based on the required specs.
    • Create Pods: kubectl run hello-pod --image=nginx --restart=Never --dry-run=client -o yaml > hello-pod.yaml
    • Expose a pod (using a service and specifying ports and service type) kubectl expose pod hello-pod --port=80 --target-port=9376 --type=NodePort
    • Create Deployments: kubectl create deploy hello-deploy --image=nginx --dry-run=client -o yaml > hello-deploy.yaml
    • Update deployment image to nginx:1.17.4: kubectl set image deploy/hello-deploy nginx=nginx:1.17.4
    • Scale a deployment: kubectl scale deploy hello-deploy --replicas=20
    • Create Jobs: kubectl create job hello-job --image=busybox --dry-run=client -o yaml -- echo "Hello I am from job" > hello-job.yaml

Regarding the exam tab, on the left, there are questions with their requirements and we can jump to any other question through arrow key. You can flag any question to return to them later. On the right, there is a unique command-line terminal for us to work on. You will get 4 already created clusters and there are commands before each question for us to conveniently switch from a cluster to another.

I practiced more on the following Kubernetes topics: Multi Containers/Side-car Containers, Deployments, Pods and Services, Network Policies, Config Map and Secrets, PVC and PVCs, Liveness and Readiness, Service Accounts, Security context, jobs/Cronjobs, Rollbacks and Rolling updates.


Practice CKAD Questions

You should practice questions from the below mentioned URLs to prepare well for the exam. These are the best links that covers almost likewise and lots of questions to practice. It will make you to use kubectl command much more which will also increase your speed. Redo practice 2-3 more times so that you can achieve the state of doing without much thinking.
  1. Below is the link for the set of curriculum wise exercises that helped me prepare for CKAD exam - https://github.com/dgkanatsios/CKAD-exercises
  2. This blog has around 150 questions to prepare for CKAD exam, this helped me alot to practice more questions - https://medium.com/bb-tutorials-and-thoughts/practice-enough-with-these-questions-for-the-ckad-exam-2f42d1228552
  3. This link has concepts and YAMLs which should need to have a go-through to understand things much better - https://github.com/twajr/ckad-prep-notes
  4. Most important link: This link is very useful to practice curriculum wise CKAD questions as it has its practice environment on Katacoda which will give you a kind of exam like feel. To access the practice environment, click on any of the curriculum mentioned and you will get redirected to Katacoda link. Once the question gets completed it will get validated first and then you will be able to move to next question. So it gives you a good way of doing practice and to prepare well for the exam - https://dev.to/liptanbiswas/ckad-practice-questions-4mpn


Some Important Aspects of Exam Questions

I would like to highlight about some of the questions that will come in the exam.

  • One of the question will come to "create multi-container pod with some command to execute", so you can create a single pod with kubectl command, then redirect to .yaml file to add another container configuration and run the kubectl create command to create the pod. Once create do cross check the running pods and try once to get into each container with kubectl exec.
  • One question will come to "create cronjob with some command to execute every minute (--schedule="* * * * *") which should be completed 10 times (completions: 10)". So you can create cronjob with kubectl command, redirect to a .yaml file and add these two parameters --schedule and completions in that yaml to create cronjob. But after that you must have to check at least one job should be completed that means - check with kubectl get pods command and kubectl get cj command to validate if at least one job should be executed before moving to another question.
  • One of the question will come to "troubleshoot the deployment already running in any of the namespaces". First it will ask to find out pods/deployment which has some issues and not able to run properly (check this through kubectl get pods --all-namespaces). Find out the pod which is not 1/1 or which has restart many times. Question will have a point to write the name of the pod and the namespace in which it is running in an existing file. Next point will be to fix the issue, so for this check using kubectl get events or kubectl describe pod <podname>. The issue might be having a liveness probe which will be failing or connection refused issue.
  • One question will come to "create pv and pvc and mount the pvc to run nginx pod". In this question, an empty file has been created and you just need to edit the file and add the pv section with the parameters given. In the same way edit another file to add pvc section with the mentioned parameters and Create pv/pvc with kubectl create command. Check whether the pv and pvc has been created or not. Create pod using kubectl run command, export into the file and add volumes/volume mount section in the file, then create the pod with kubectl create command. Cross check the mounts by describing the pod.
  • One of the most important question will come from Network Policies concept. The question is quite tricky and if someone will have good understanding of labels/selectors then you will be able to solve it. Question is like: "There are two network policies already created in x namespace. A pod named <newpod-123> is running for you in the same namespace. Apply the already created network policies to the pod named <newpod-123> to allow traffic/access only from 2 pods front and storage. You don't have to edit/change/modify/delete already created network policies, rather you have to edit the pod to apply the policies". Now you need to check the pods in the namespace first, so 3 pods named front, storage and <newpod-123> will be running. Now check the network policies using kubectl get netpol command. There will be two network policies already created with the pod selector labels on each as app: front and app: storage. Now you need to edit the pod named <newpod-123> to add those 2 pod selector labels of the already created network policies. (I am still doing research on it to solve this question).
  • One question will come to "create multi-container pod with a sidecar container (like fluentd) to collect the logs from the main container which has some command to execute". This question is very important and has more weightage as well. This question will have some more points like, "you need to mount /tmp/logs to both the containers for log collection. Also create a fluentd sidecar container to collect logs at /tmp/log/output.logs". So you need to go through the whole question as the question has more points that need attention too. Now the next point will be, "you don't need to have any knowledge on fluentd to do this question, you need to create the configMap from a given file <filename>.yaml and mount the configMap to the sidecar container to configure fluentd to collect logs". Solution: So you don't need to confuse here, what you have to do is create a yaml with kubectl run command and export in a file, then add another container with the image name mentioned in the question, now you need to add emptyDir as the volume and mount that volume to both the containers. Then create configMap with the mentioned file name by just running kubectl create command and add the configMap in volumes section like this: 
  volumes:
    - name: shared-vol
      emptyDir: {}
    - name: config-volume
      configMap:
        name: special-config

Then mount the above config-volume in sidecar container 
      volumeMounts:
      - name: shared-vol
        mountPath: /tmp/logs
      - name: config-volume
        mountPath: /etc/config

Now you have multiple volumes and multiple volumes mounts in the YAML as per the question, then create the pod with kubectl create command and check the running pods. Also do cross check wether the logs has been generated or not, to do that you have to get into the sidecar container with kubectl exec and check the file with cat in /tmp/logs/output.log. If you are getting the logs that means you have successfully completed the question.

Note: In every question, you must need to use -n <namespace> to run/create pods/deployments in the namespace mentioned in the question. If you don't use -n <namespace> option, it will get created in another/current namespace and your question will not get evaluated. So try to practice questions with this -n option for particular namespaces.


Kindly read all the above important aspects of Questions, it will help you in the exam when such kind of questions will come to quickly understand and perform.

I hope you’ll find this information useful to start your journey towards CKAD Certification. For any query, you can reach out to me via:

Comments

  1. A great insight to the exam preparation Shashank. Thank you for sharing your experience and tips.

    ReplyDelete
  2. Nice summary and really helpful

    ReplyDelete
  3. Perfect information. Thanks indeed!

    ReplyDelete
  4. Thanks a lot for detailed exam pointers. Will reach out to you.

    ReplyDelete
  5. This is really useful blog shashank and thank you for putting your effort for creating this blog with details and this blog will definitely help others

    ReplyDelete
  6. Thanks for sharing the great information! Masters program in video editing course online is an 8 months hybrid training (Recorded Videos + Live Sessions) which also includes 2 months of internship. Best online graphic design courses teach students the basics of video editing, composition, motion graphics, etc. In this program, students master all tools and techniques of Adobe Premiere Pro as well as fundamentals around production and editing to become Expert Video Editor.
    Check out more courses:
    digital marketing course with internship
    online photo editing course
    figma tutorial in hindi

    ReplyDelete

Post a Comment

Popular posts from this blog

DevOps Interview Questions

Calico Certified Operator: AWS Expert Questions & Answers