CKAD (Certified Kubernetes Application Developer) Scribbles
Some useful notes for CKAD preppers.

Resources
Udemy
This udemy course gives a really good run-through of the Kubernetes API objects and how to create them. It contains video tutorials as well as hands-on labs using the free Kodekloud subscription included in the course.
Kubernetes Certified Application Developer (CKAD) with Tests
Kodekloud
Certified Kubernetes Application Developer (CKAD)
Ultimate Certified Kubernetes Application Developer (CKAD) Mock Exam Series
The full learning path may be useful for beginners: https://kodekloud.com/learning-path/ckad/.
The Notes
Disclaimer: all notes are my own, and createed with no knowledge/experience from the exam itself.
Alias for kubectl
The real exam already has this setup, but the Kodekloud machines do not. Saves a bit of typing. Command:
alias ‘k=kubectl’
Autocompletion
Autocomplete is enabled for kubectl commands in both the exam and Kodekloud.
VIM
It’s definitely worth learning the VIM text editor ahead of the exam. These are a few of the useful commands that I used a lot:
- Turn on line numbers:
:set number
- Undo the last change:
:u
Base64
You may need to know how to encode/decode a secret.
- To encode:
echo <input-string> | base64
- To decode:
echo <base64-string> | base64 -d
Environment Variables
If you need to exec into a pod and verify it has the expected env variables:
printenv
Use cat to edit files if no text editor is installed
cat > file.txt
<text>
<empty line>
ctrl + c
Use kubectl create to create most resources quickly
kubectl create -h
To create a service that exposes a pod, use kubectl expose
Kubectl expose
To create a resource and output the yaml directly via dry-run (works with kubectl run and kubectl create:
kubectl run <name> –image=<image> -o yaml –dry-run=client
To search Kubernetes object by apiVersion
kubectl api-resources
To troubleshoot why PVC is not bound — use describe
kubectl describe <pvc>
To update labels / annotations of pods
kubectl label pods <new-label> -l <label-selector>
kubectl annotate pods <annotation-key>=<value > -l <label-selector>
To view more details in the output of the get command use -o wide
Kubectl get -o wide
Get PODS with custom columns
kubectl get pod –output=custom-columns=”<column-name>:<spec>”
https://kubernetes.io/docs/reference/kubectl/#custom-columns
Check status of Ingress — check for ingress controller, which is a deployment
Kubectl get deployment -A

When question asks you to set userID for specific container, make sure you do securityContext on container

Creating a network policy to apply to a whole namespace:
When creating a container with the busybox image, make sure to add a sleep command or it will terminate
List All Running Container Images Running in a Cluster
To get IP addresses of Nodes
Kubectl get node -o wide
Test ClusterIP Service — create a debug pod in node. If it is a NodePort service, just curl node IP + Port
Kubectl debug node/<node-name> -i -t –image=<busybox>
Resource Quotas for API Objects
Resource Quotas limits vs requests
https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/
CustomResourceDefinition — Status and scale subresources are defined in the openApiv3Schema

CRD metadata.name has to be
<plural-name>.<group>
Set .spec.backoffLimit
to specify the number of retries before considering a Job as failed
To make sure service routes traffic to 2 different deployments, make sure to use the same label selector
To get values of Helm release, and manifest
helm get all <release-name> -n <namespace>
To update helm values of release
Helm upgrade <release-name> <repo/chart-name> — set <key>.<value>
Helm Chart — To show parameters and general info
helm show all <repo-name>/<chart-name> — version=<version>
Get ALL helm releases with no filter (regardless of status)
helm list -a