Preparing for CKA and CKAD
Table of Contents
Some study tips you may not have found elsewhere for the Kubernetes CKA and CKAD exams
1 Which exam is harder? BOTH!
1.1 what's easier about CKAD
- fewer challenges: 19 in 2 hours
- mostly sticks to kubectl land
- super relevant to SE work!
1.2 what's harder about CKAD
- less time per challenge (19 / 120 minutes == ~6 minutes per)
1.3 what's easier about CKA
- More time per challenge (8+ minutes per)
- One hour extra time, but only 5 additional challenges (24 in 3 hours)
1.4 what's harder about CKA
- Gotta know sysadmin for K8s and Etcd
- Have your
etcdctl
,systemd
,openssl
basics down pat
- Have your
2 Study resources
2.0.1 CKA
- How I passed the CKA (Certified Kubernetes Administrator) Exam by Nilesh Jayanandana
- CNCF Certified Kubernetes Administrator (CKA) exam tips & tricks by Aliaksandr Lubouski
- Nail Your Kubernetes Admin Exam on the First Try. Tips & Tricks from a Certified Administrator.
- The Ultimate Guide to Passing the CKA Exam - James Strong on Medium
2.0.2 CKAD
- CKAD Exam Notes by Igor Izotov
2.0.3 Kubernetes the Hard Way
- What it will teach you for CKA
etcd
- certificate generation
- order of bootstrapping nodes
- What it will not teach you
- Using
kubeadm
(used in the exams and in Konvoy) - examining and fixing certificates
- lots of other stuff
- The certificate generation was not useful in the exams - instead, you will need
openssl
to examine certificates and eitheropenssl
orkubeadm
to refresh
- The certificate generation was not useful in the exams - instead, you will need
- Using
2.0.4 Killer.sh - CKA and CKAD test simulators! (pay) paid
3 Resources that may be used during the exam
During the exam, only one non-tty tab can be open, and only the kubernetes.io
or
the kubernetes repo on github may be visited
- Bookmark sections of the docs site beforehand
- Get proficient using
kubectl explain
- kubectl cheat sheet
- Community discussion page - great place to search for solutions to problems
- Kubernetes documentation
kubectl explain <resource>.<key>
4 Hip tips for both tests
4.0.1 Practice a lot with Gate One
This is the browser based shell that is used for the exams.
This is supposedly available to test at http://liftoffsoftware.com/Products/GateOne, but I have had zero success with the site. This mirrors the experience of many people on the intertubes.
Fortunately, I found a working container for this.
On Docker:
docker run --name=gateone -p 443:8000 -d yovio/gateone
On K8s:
kubectl run gateone --image=yovio/gateone --restart=Never --port=443 kubectl expose pod gateone --port=8000 --target-port=443
Use Cloud load balancer or `kubectl port-forward` to access
4.0.2 Be fast with vim
- Move/change/delete by word
- Repeat command
- Global search/replace
- Multiline select and indent
4.0.3 Practice setup of alias and vim
settings
vim
settings in~/.vimrc
set expandtab set tabstop=2 set shiftwidth=2
- Alias and auto-completion
Test that Bash completion is working with
kubectl
:kubectl conf<TAB> # should expand to kubectl config
Set your aliases in
~/.bashrc
alias k='kubectl' alias k='kubectl config set-context --current --namespace ' alias kx='kubectl config get-contexts'
4.0.4 Get awesome with imperative kubectl
Avoid editing YAML from scratch at all costs. The `kubectl run` command is being deprecated, but is availabe as of 1.16.x - so use it!
# Create a pod k run mypod --image=nginx --restart=Never --labels=app=mypod # Create a Deployment - this is the default, so --restart may be omitted k run mydeployment --image=nginx --restart=Always --replicas=3 # Create a Job k run myjob --image=nginx --restart=OnFailure # Create a Service k expose deploy mydeployment --port=8080 --target-port=80 --type=NodePort --name myservice # Create a DaemonSet by creating manifest for Deployment, then editing
- Never create a service with YAML - use
k expose
- Test a service with
k get ep
4.0.5 Learn some little about JSONPATH and –sort-by
Remember -o wide k get <manythings> and -o name for k get <anything>
4.0.6 Just prior to the exam
4.0.7 Approach when first logged in
- Step 1: Assure
vim
settings are correct in ~/.vimrc
set tabstop=2 set expandtab set shiftwidth=2
- Step 2: suss environment
w cat /etc/os-release
- Step 3: install
bash-completion
andtmux
On CentOS/Red Hat
sudo yum install bash-completion tmux source ~/.bashrc
On Debian/Ubuntu
sudo apt install bash-completion source /etc/bash_completion
- Step 4: aliases and completion
alias k='kubectl' alias kn='kubectl config set-context --current --namespace ' alias kx='kubectl config get-contexts' ## notes file: add, edit, notes (view) alias a='echo >> ~/.notes.txt ' ## save my kubectl explain thangs in fast text files source <(kubectl completion bash) complete -F __start_kubectl k