DEV Community

Andrew
Andrew

Posted on

CKAD Exam: The Essential Cheatsheet I Wish I Had When I Started

Why I Made This Cheatsheet

Studying for the CKAD (Certified Kubernetes Application Developer) exam, I found myself constantly jumping between docs looking for the same kubectl commands and YAML templates.

So I compiled everything into one quick-reference cheatsheet. Sharing the key parts here — hopefully it saves you some time.


First Things First: Exam Setup

Run these immediately when your exam starts:

alias k=kubectl
alias kn='kubectl config set-context --current --namespace'
export do='--dry-run=client -o yaml'
export now='--force --grace-period=0'
Enter fullscreen mode Exit fullscreen mode

These save massive time. Instead of typing kubectl 200 times, you type k.


Generate YAML Instantly

Don't write YAML from scratch. Generate it:

# Pod
k run nginx --image=nginx $do > pod.yaml

# Deployment
k create deployment nginx --image=nginx --replicas=3 $do > deploy.yaml

# Service
k expose deployment nginx --port=80 $do > svc.yaml

# Job
k create job my-job --image=busybox $do > job.yaml

# CronJob
k create cronjob my-cron --image=busybox --schedule="*/5 * * * *" $do > cron.yaml
Enter fullscreen mode Exit fullscreen mode

Then edit the YAML as needed. Way faster than writing from memory.


Quick Resource Templates

Pod with Resource Limits

apiVersion: v1
kind: Pod
metadata:
  name: myapp
spec:
  containers:
  - name: myapp
    image: nginx
    resources:
      requests:
        memory: "64Mi"
        cpu: "100m"
      limits:
        memory: "128Mi"
        cpu: "200m"
Enter fullscreen mode Exit fullscreen mode

ConfigMap Usage

spec:
  containers:
  - name: app
    envFrom:
    - configMapRef:
        name: my-config
    volumeMounts:
    - name: config-vol
      mountPath: /etc/config
  volumes:
  - name: config-vol
    configMap:
      name: my-config
Enter fullscreen mode Exit fullscreen mode

Probes (Know All Three!)

spec:
  containers:
  - name: app
    livenessProbe:
      httpGet:
        path: /healthz
        port: 8080
      initialDelaySeconds: 15
      periodSeconds: 10
    readinessProbe:
      tcpSocket:
        port: 8080
      initialDelaySeconds: 5
    startupProbe:
      exec:
        command: ["cat", "/tmp/healthy"]
      failureThreshold: 30
Enter fullscreen mode Exit fullscreen mode

Must-Know Commands

Task Command
Switch context k config use-context <name>
Set namespace k config set-context --current --namespace=<ns>
Get all resources k get all -A
Describe resource k describe pod <name>
Logs k logs <pod> -c <container>
Exec into pod k exec -it <pod> -- /bin/sh
Delete fast k delete pod <name> $now
Scale k scale deployment <name> --replicas=5
Rollback k rollout undo deployment/<name>

Exam Tips

  1. Always check the context — each question specifies one
  2. Use imperative commands — faster than writing YAML
  3. Use kubectl explaink explain pod.spec.containers
  4. Don't get stuck — flag and move on
  5. Bookmark the kubectl cheatsheet in your exam browser

Full Cheatsheet

I put together a complete 15+ page PDF covering all 5 exam domains:

  • Application Design & Build
  • Application Deployment
  • Observability & Maintenance
  • Environment, Config & Security
  • Services & Networking

👉 Get the full CKAD Cheatsheet here


What Helped You?

If you've passed CKAD, what resources made the difference? Drop a comment — always looking to improve my prep!

Good luck to everyone studying. You got this! 🚀

Top comments (0)