Kubernetes for Application Developers (CKAD)
A blog about how to get certified as a Kubernetes developer (CKAD) with handy tips and tricks along the way
Join the DZone community and get the full member experience.
Join For FreeI was lucky. I already had extensive knowledge of Docker before starting the certification for Kubernetes developer (CKAD), and I have an employer that gives me the space and time to invest in myself.
So I claimed a week of preparation and did the whole Kubernetes for Developers (LFD259) course. To follow this course, you have to prepare a practice environment, and you are given instructions on how to do that on AWS or Google Cloud (which can result in extra costs). It is also very possible to create a cluster on your local machine. To make my life easier (and cheaper), I opted for the last option and created a vagrant setup with instructions for it here.
The LFD259 course covers everything needed for the certification, and it is created by the organization also responsible for the certification exam. Much of the course is self-study and reading. One of the downsides of this course was that if something went wrong and you had a question, you had to ask it on a forum, and responses to that forum could take a long time.
So to prepare even more, I bought the Udemy course Kubernetes Certified Application Developer (CKAD) with Tests. Normally this course is about $200,= but I bought it in a bundle (with Kubernetes for Administrators - CKA) for about $35,=. A good deal, as far as I am concerned. Udemy excels in video courses, and that visualization made the needed knowledge complete.
A nice extra of the Udemy course was that it came with prepared exercises on KodeKloud. Very nice! and with practice exams and lightning labs.
After a week of following courses and practicing a lot, I scheduled the exam. In all honesty, I was quite nervous. I scheduled my exam a week later for some extra practice, and that is what I did.
Practice, practice, practice. Speed is what you need!
Tips and Tricks
I have created a GitHub page with all the resources I used, with an extensive list of tips and tricks. Here are some of the more important ones.
Practice for Speed!
The biggest challenge is getting it all done within the allotted time. You have to complete 19 questions in two hours, and in that time, you have to write YAML files and edit them in one of the basic Linux editors (vi / nano). I recommend investing in vi knowledge as it is much more powerful than nano.
The mentioned Udemy course has a few lightning labs at the end of the course. If you can finish them within the given time, you are very much on track.
Use kubectl
Over YAML as Much as You Can
YAML is a pain to write, and cut and paste can be a hassle with mixed tab and whitespace characters. So much can go wrong here!
Please don't write yaml files from scratch!
Use kubectl run
with the dry-run (--dry-run=client -o yaml
) option, whenever you can, to at least generate as much of the YAML as you can. Practice this a lot and find more options.
# this is much faster
kubectl create deploy mydeploy --image=nginx --port=80 --replicas=4
#than
kubectl create deployment mydeploy --image=nginx --port=80
kubectl scale deployment mydeploy --replicas=4
And if you need to add more options not provided from the command line, use the dry-run:
kubectl create deploy mydeploy --image=nginx --port=80 --replicas=4 --dry-run=client -o yaml>mydeploy.yml
vi mydeploy.yml
# edit what you need done and apply/create
Create a Good Set of Bookmarks
You are allowed to have the kubernetes.io docs open in a second tab during the exam and this is powerful stuff. Create an extensive set of bookmarks pointing to all the needed examples. I have exported the bookmarks I used during my exam, and it was pure gold! Very useful.
Use Bash to the Fullest
Typing --dry-run=client -o yaml
is very cumbersome every time you want a dry-run to generate a YAML, but by putting it in a variable, it becomes easy.
export DR='--dry-run=client -o yaml'
Now, if you want a dry run, you can just do:
kubectl create deploy mydeploy --image=nginx --port=80 --replicas=4 $DR >mydeploy.yml
#or
kubectl run hello --image=busybox $DR>hello.yml
This is just very basic stuff but saves a lot of time.
If you want to get fancier, do more!
source <(kubectl completion bash)
#setting the namespace (just do this one again for another namespace if needed)
export NS=default
# You will do dry runs often and now you can just type $DR in stead of the whole thing
export DR='--dry-run=client -o yaml'
# use k to run the kubectl command in the exported namespace. Saves typing
alias k='kubectl -n $NS'
# Now get code completion on the 'k' commands
complete -F __start_kubectl k
Now, this is a setup made for speed :-)!
You can use k
instead of kubectl
with bash-completion (tab) on the command, and you can make it into a dry-run by just adding $DR
to it. If you have to perform multiple commands on a different namespace, just perform this command first NS=otherns
and use k
again as normal. All this demands practice because you must not forget to change back to the default namespace again when needed, but they can be great time savers.
Useful Resources
- CKAD-Resources - For many more tips, tricks, and useful links.
- k8s-cluster - For a local VirtualBox/vagrant-based k8s cluster.
- Kubernetes for Developers (LFD259) - Linux Foundation CKAD course
- Kubernetes Certified Application Developer (CKAD) with Tests - Udemy CKAD Course
Published at DZone with permission of Ivo Woltring. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments