CKAD (Certified Kubernetes Application Developer) is the certification delivered by the Linux Foundation, to validate developer skills on Kubernetes.
First, you can use Udemy course to go through the program you need to know, taking notes on things you want to review.
it's a good way to go through the whole program.
With Udemy, you have access to Kodekloud which is a simulator to practice alongside video lessons.
But you should know that this certification is essentially a test of speed and that it is absolutely necessary to train with a simulator close to the conditions of the exam, to not be surprised : Killer.sh (note that it's a little harder than the actual exam).
So you have the resources to be ready, now I will share some tips to gain precious seconds during the exam, because it will be very fast.
Edit your ".bashrc" file with this values, learn them by heart, you will see in the next steps that they will be usefull :
# to speed up pods termination
# to print values of resources
# for context switching
alias kshow='kubectl config get-contexts'
alias kx='kubectl config use-context'
alias kn='kubectl config set-context --current --namespace'
With this simple commands you can navigate quickly between contexts and namespaces on Kubernetes (without any plugin required) :
# Show current context and namespace
# Select context "kind-kind1"
# Select namespace "default"
It is very important to know this commands, you will need them for each new exercise on the CKAD exam.
The first question to ask yourself, for each new exercise is : "Which context and which namespace ?".
You will have to manipulate Yaml files pretty often.
For Vim, you have to handle copy/paste, and to switch between files, the
:e myfile command is convenient, and you have to learn to switch between buffers.
Here is a Vim cheatsheet that can help you.
You will have between 16 and 19 questions, depending on the exam.
You can create a folder, and name your files like this :
01_pod.yaml (01 being the question number), in order to find the files of the previous questions when needed.
There is a flag system, if you are not sure, just flag the question and come back later.
You can do the things you know, even if it's incomplete. You will have a percentage of points based on each action you have done well.
To create a resource, get the informations :
k create deploy --help
Then, you can create the resource directly with imperative command :
k create deploy mydep --image=nginx --replicas=3
Or create it with the generated manifest file, like this :
# Deployment example :
k create deploy mydep --image=nginx --replicas=3 $dry $o > 01_dep.yaml # edit it
k apply -f 01_dep.yaml
# Cronjob example :
k create cronjob myjob --image=busybox --schedule="*/1 * * * *" $dry $o -- sh -c "date" > 01_cronjob.yaml # edit it
k apply -f 01_cronjob.yaml
You will have access to the Kubernetes documention, learn to navigate in it, by knowing the good keywords (for instance, "cheatsheet", that might be helpful), and resources you can’t handle with
k create, try to handle all the program with it.
Be careful, sometimes keywords are not obvious, for services, think to expose, for secrets, think to credentials, etc.
With explain you can have the complete list of parameters. If you need to find one, it can be complementary and easier to find than on the documentation :
k explain po.spec > po-spec
k explain po --recursive=true > po-full
k explain job.spec > job-spec
k explain job --recursive=true > job-full
Like this :
k edit deploy mydep
Or by extracting the yaml output :
k get deploy mydep $o > 01_dep.yaml # edit it
k apply -f 01_dep.yaml
Be careful, it is not possible to edit specifications of pods directly, you have to destroy and create them again (except for some elements, like labels or annotations).
Like this :
k run nginx --image=nginx:alpine --rm -it --restart=Never -- curl https://www.google.com
Or (Busybox is faster) :
k run busybox --image=busybox --rm -it --restart=Never -- wget -qO- https://www.google.com
You will have to use curl or wget to check if your services are well exposed, you have to be familiar with this.
Some commands will help you for that :
# Get extra informations, like exposed IPs for instance
k get po -o wide
k get node -o wide
# Get labels of pods
k get po --show-labels
You can gain some seconds by deleting a pod like that, to force deletion :
k delete mypod $f
There are complementary tools that you must know for the certificate, like Helm and Docker (or Podman, you have the choice, it's pretty much the same commands than Docker).
Also take the time to get comfortable with them.
The Helm documentation, with a convenient cheatsheet is allowed during the exam.
At this stage, you have good tips to go fast at this test, ensure you are comfortable with all the notions of the program and it should be fine.
Remember, practice, practice, practice, for this exam, this is the key.