Recently i passed CKAD (Certified Kubernetes Application Developer) Exam. I must admit, this is the most challenging IT exam that I’ve ever taken. The main reason was the exam is 100% hands-on. No multiple answer nor True / False. But i also feel this was the most fulfilling exam. Here’s my cert
There are two variants of Kubernetes Certification, namely CKAD and CKA. In nutshell CKAD is designed for software developers who’d like to develop and deploy their apps in Kubernetes. While CKA is designed for the IT administrators who are managing the Kubernetes clusters. In general, CKA covers broader topic than CKAD does. You can learn about the similarities and differences between the two exams here.
In this article, I’d like to share with you some of the tips to acquire it.
But before talking about the tips, I wanna start with the learning material first.
There are a lot of learning material online. Some of them are free, while others are not. I’d recommend you enrolling to Introduction to Kubernetes if you are new to K8S. But i don’t think it’s enough to pass the exam only with this introduction course.
The official training material is from CNCF: Kubernetes for Developers. You can checkout the offer here such as learning material + exam at discounted price.
I mainly leveraged on three contents:
Kubernetes Learning Path
which can be download here
. It has 50 days from zero to hero learning plan, including videos, hands-on, documentation, etc. It cover the basic Kubernetes concept and uses Azure Kubernetes Services
as example. The content used in this learning path is mostly free.
I think it’s an excellent paid course. Not only Mumshab explains the topic really well (with nice animated deck) but also the hands-on exercise at the end of each topic as can be seen below. The left hand side displays the quiz portal while the right hand side is the terminal that you’d have to type in some command to get the right answer.
I also appreciate the Lightning Exams and the Mock Exams (along with the solutions) at the end of the course to provide us the feeling of the exam. It’s helpful.
This is to cross validates what I’ve learnt so far and be more fluent in dealing the questions.
Tips of passing the exam
Now, let’s move on to some tips on how to conquer the exam!
The main challenge of this exam is TIME MANAGEMENT so you have to manage it very well.
1) You need to be fluent with vi/vim in editing YAML!
You will have to deal with a lot of yamls in the exam. As such, vi/vim is the to-go option. Vi/Vim is no doubt a very powerful and popular text editing tool in Linux world but i in my opinion, the learning curve is very high (especially for folks who are coming from the “Windows” world). It has lots of “secret / magic” commands. I would strongly encourage you to invest your time on vi/vim if you are not familiar with it because it will save your time significantly during the exam.
Here are my top 5 useful command in yaml editing:
- [in command mode] SHIFT zz to exit with saving (I think it’s much effective than :wq!)
- [in command mode] dd to cut, or yy to copy the whole line, and p to paste
- [in command mode] :set number to display line number
- [in command mode] u to undo
- [in command mode] :%s/foo/bar/g to search all occurrence of foo and replace it with bar
You can find many of vim tutorial online but please be mindful don’t overload your brain with vim, leave some space for the CKAD content .
2) You need to invest some effort and time in Unix / Linux command
During the exam, you will be using a web-based unix/linux terminal (yeah NO GUI). As such you will need rudimentary linux knowledge. Again, similar to the first tip, Linux engineer shouldn’t find this challenging but if you’re coming from Windows world, make sure than you invest some time and effort on it. Other than the super basic commands such as cd, ls, cat, cp, mv, mkdir, rm, and rmdir, I found these pretty useful too:
You can learn more about other Linux commands here.
3) Get familiar with Kubernetes docs especially the example.
During the exam, you can browse the docs like (https://kubernetes.io and https://github.com/kubernetes) but you’re prohibited to access other links. Even though you can access the Kubernetes doc, time is a big challenge and i bet you won’t have enough time to read thoroughly. As such, get familiar with the structure of the docs including the examples. So that you can copy-paste the appropriate example to your terminal with minimum modification.
As an example, if you search the keyword “persistent volumes” (aka pv) in the http://kubernetes.io you will find the following result. It’s important to understand the objective of each links / result.
- The first link shows many details including the concept of pv and pvc
- The third link provides more holistic example on how we first create pv, then pvc. Finally consume it from the pod. No doubt it’s not as detail as the first link about pv, but you’ll notice that the example of the yaml are very helpful as an end-to-end lifecycle.
4) Get familiar with the Kubernetes’ object’s short names.
If you type ‘kubectl api-resources’ you will see:
I’d encourage you to memorize them at least the commonly used ones such as:
- no for nodes
- po for pods
- deploy for deployments
- rs for replicasets
- pv for persistentvolumes
- pvc for persitentvolumeclaims
- ns for namespaces
It will save you a few seconds on each command. But when you add them all, you will save a good amount of time.
5) Create your own short-forms aka alias
This is another time-saving tip. Create your own alias to save typing the long command. Always do these at the beginning of the exam.
Here are some of mine:
- alias k=’kubectl’
- alias kgp=’kubectl get pods’
- alias kgpan=’kubectl get pods –all-namespaces’
- alias kdp=’kubectl delete pods’
- alias kd=’kubectl describe’
You may find out how other folks improve their productivity here:
6) Imperative follow by declarative (-o yaml –dry-run)
There are typically 2 ways to creating Kubernetes objects. Imperative way (thru kubectl) or declarative way (thru yaml then kubectl apply/create). Obviously, you don’t have to hand-write every single yaml lines, you may copy and paste the example from Kubernetes doc and modify them accordingly.
- Generally saying, it’s faster to do it in imperative way. But not all the options can be specified with imperative.
On another hand, declarative is more powerful as you can basically specify whatever options. But navigating and editing a yaml (especially a long yaml file) is NOT FUN . Ouch, you got an error when there’s just an extra space – you know what I mean!
“YAML is very readable but not very writeable.” – Wely Lau
Wouldn’t be great if we can combine the two techniques? Yes, you can, and here’s how you would do it with the help of –dry-run and -o yaml options.
- –dry-run option is commonly used to validate if the command (and parameters) are correctly specify without really running it
- -o yaml option is used to produce an output in yaml format
The idea is to use imperative command (with any option that you perform) to produce a yaml file, then edit those options which can’t be specified in imperative.
Assuming you are asked to create a deployment with 4 replicas, nginx image. You may do it as following:
$ k create deploy nginx-deploy –image=nginx –dry-run -o yaml > nginx-deploy.yaml
This produce a yaml file named nginx-deploy.yaml. Then you use vi/vim to edit replicas option in the yaml file. This is because we are unable to specify the replica option in the imperative kubectl create deploy command.
Then finally run kubectl apply -f nginx-deploy.yaml.
For me, this technique saves more time than copy-paste from the example, especially when there are too many things to be edited. It increases the risk of yaml syntax error.
7) Be extra careful with namespace
This sounds simple but it’s a very common pitfall. Some of the command requires you to place the resource on specific namespace.
But if you forgot to specify it, it will be placed on the “default” namespace as the default behavior. And you’ll be penalized with 0 mark for that answer.
You can specify the namespace either thru imperative kubectl command with -n (or –namespace) option such as:
Or do it declaratively in metadata section as can be seen here:
8) Pick the “right” questions strategically.
The priority is to attempt the questions which you have high confident that you can complete it. Keep in mind that the percentage of each question is displayed on top. This will help you determine if it’s worthwhile to spend time on the question of skip over to attempt the next one.
For sure, don’t spend too much time on 1 question. This is a pitfall for many engineers (me included), especially when troubleshooting. The curiosity of getting it fixed! Arh… you know what I mean. But please, do practice this during the exam. Move on to attempt others, you can go back if you have time.
Sum it up
That’s all for this post, folks. I shared with you 3 learning materials that I used to prepare my exam. Also shared with you 8 tips on how to manage your time strategically in the exam.
Finally, I wish you good luck to take your CKAD/CKA exam!