Skip to content
Tutorials Center
My learning

Topics

Lesson 77 of 78 ยท Practice

CKA, CKAD and CKS Study Guide

Prepare for the Kubernetes certifications: exam domains, kubectl speed tricks, imperative generators, aliases, time management and practice tasks for CKA, CKAD and CKS.

The Linux Foundation and the CNCF run three hands-on Kubernetes certifications: CKA (Certified Kubernetes Administrator), CKAD (Certified Kubernetes Application Developer) and CKS (Certified Kubernetes Security Specialist). They are not multiple-choice tests. You get a terminal connected to several real clusters, a list of tasks, and about two hours. Knowing Kubernetes is necessary; being fast with kubectl is what turns knowledge into a pass.

This lesson is a study plan, not a promise. The exam rules, versions, weights and prices change, so read the current candidate handbook and curriculum on the official site before you book. Everything here is read-only advice and commands. Two runnable Python stand-ins train the skills that matter most: generating manifests the way kubectl --dry-run=client -o yaml does, and planning your time across tasks. They model the idea; they are not the exam environment.

Three exams, three jobs

CKA Run and repair clusters.
CKAD Build and ship applications.
CKS Harden clusters and workloads.

CKS needs a valid CKA first; check the handbook for current rules.

1 / 2

The three exams at a glance

CKA CKAD CKS
Audience Administrators, SREs Developers Security-minded operators
Main skill Install, configure, troubleshoot Design and deploy apps Lock down and audit
Style Performance-based tasks in a terminal Same Same
Prerequisite None None Valid CKA
Reference material Official Kubernetes docs (and a few linked sites) are allowed Same Same, plus some security tool docs

The weights below are approximate and were published in the curricula at the time of writing; check the current curriculum before you plan.

CKA domains: cluster architecture, installation and configuration (about a quarter); workloads and scheduling; services and networking; storage; and troubleshooting, which is the heaviest domain at roughly 30%. Expect tasks such as fixing a broken kubelet, backing up etcd, upgrading with kubeadm, writing RBAC and finding why a pod is Pending.

CKAD domains: application design and build (images, Jobs, multi-container pods, volumes); deployment (rolling updates, Helm, Kustomize, blue-green and canary); observability and maintenance (probes, logs, API deprecations); environment, configuration and security (ConfigMaps, Secrets, security contexts, ServiceAccounts, resource limits); and services and networking (Services, Ingress, NetworkPolicy).

CKS domains: cluster setup (network policies, CIS benchmarks, ingress TLS); cluster hardening (RBAC, service accounts, upgrades); system hardening (host surface, AppArmor, seccomp); minimizing microservice vulnerabilities (Pod Security, secrets, runtime sandboxes, mTLS); supply chain security (image scanning, signing, admission); and monitoring, logging and runtime security (audit logs, Falco).

Study map: the free lessons here cover most of the ground. For the CKA, work through Cluster Architecture, Cluster Operations and Upgrades and the Troubleshooting Playbook. For the CKAD, focus on Pods, Deployments, Jobs and CronJobs and Services. For the CKS, read Authentication and RBAC, Pod Security and Security Contexts and Supply Chain and Cluster Hardening.

Set up your shell in the first minute

Typing is the bottleneck. Spend the first minute on a few lines; the exam shell is bash and vim is the default editor.

Terminal
alias k=kubectl
export do="--dry-run=client -o yaml"
export now="--force --grace-period=0"
source <(kubectl completion bash)
complete -o default -F __start_kubectl k
TEXT
# ~/.vimrc, so YAML indents with spaces and tabs are two columns wide
set expandtab
set tabstop=2
set shiftwidth=2

With these, k run web --image=nginx $do > pod.yaml writes a manifest in a few seconds, and tab completion finishes resource names. Check whether the exam environment already provides the alias and completion, since some versions do. Practice with exactly this setup until it is muscle memory.

Two more habits matter:

  • Switch context first. Every task states a cluster or context; run the given kubectl config use-context ... command before anything else and re-check with k config current-context. Working on the wrong cluster is the most expensive mistake.
  • Set the namespace with -n, or for a block of tasks with k config set-context --current --namespace=NAME.

Imperative generators

Writing YAML by hand is slow and error-prone. The fastest route is to let kubectl generate a starting manifest and edit only what is missing. --dry-run=client -o yaml prints the object without creating it.

Terminal
# Pods and Deployments
k run web --image=nginx:1.27 --port=80 $do
k create deployment api --image=nginx --replicas=3 $do
k scale deployment api --replicas=5
k set image deployment/api nginx=nginx:1.27.1
k rollout status deployment/api
k rollout undo deployment/api

# Services
k expose deployment api --port=80 --target-port=8080 $do
k create service nodeport shop --tcp=80:8080 $do

# Configuration
k create configmap app-cfg --from-literal=MODE=prod --from-file=app.properties
k create secret generic db --from-literal=password=s3cret
k create serviceaccount ci

# Batch
k create job once --image=busybox $do -- echo hello
k create cronjob nightly --image=busybox --schedule="0 2 * * *" $do -- date

# Access control
k create role pod-reader --verb=get,list --resource=pods
k create rolebinding rb --role=pod-reader --serviceaccount=default:ci
k auth can-i list pods --as=system:serviceaccount:default:ci

# Scheduling
k taint nodes node1 dedicated=gpu:NoSchedule
k label nodes node1 disktype=ssd
k autoscale deployment api --min=2 --max=10 --cpu-percent=70

Anything the generators cannot express, such as probes, volumes, affinity, security contexts and init containers, you add by editing the generated file. Find the exact field names with k explain pod.spec.containers.securityContext --recursive or by searching the docs and pasting the example. Generated manifests also carry the right apiVersion, which removes a whole class of typos.

The stand-in below shows what a generator does: it builds the object from a few flags and prints YAML. The real kubectl output also includes empty fields such as creationTimestamp: null; this model omits them to stay readable.

Python A tiny manifest generator

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the Service selector copies the Deployment's labels: that link is the same one you debugged in the exercises, and the generators wire it for you.

Time management

You have roughly two hours for around fifteen to twenty tasks, so the average is six to eight minutes. Tasks carry different weights, and the weight is shown with each task. Points are earned per task, often with partial credit for each correct requirement, so a half-finished task still scores.

Rules that work:

  1. Read all tasks quickly, note weight and difficulty, and start with the quick, high-value ones.
  2. Set a cap per task of about twice its expected time. If you are stuck, flag it in the notepad and move on.
  3. Verify each task with a read command (k get, k describe, curl from a debug pod) before moving on; a task that "looks done" but has a typo in a label scores nothing.
  4. Reserve the last ten to fifteen minutes for flagged tasks.
  5. Never lose time to the clock-sinks: waiting for a rollout without working on something else, or re-typing what the docs example gives you. Copy from the docs.
Python Plan your time across tasks

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Real exam tasks do not come with honest estimates, so treat the numbers as a drill: the habit is to rank by points per minute, leave the expensive tasks for later and always keep a reserve.

Common traps

  • Wrong context or namespace. Re-check after each context switch.
  • Editing the live object. For a pod, changing most fields requires deleting and re-creating it; edit the YAML file and k replace --force -f pod.yaml, or recreate from the generated file.
  • YAML indentation. The .vimrc above prevents tab characters. Use k apply --dry-run=server -f file.yaml to catch schema errors before applying.
  • Forgetting to expose or label. Selectors must match the pod labels exactly.
  • Not saving output. If a task asks for an answer in a file (> /opt/answer.txt), check the file with cat.
  • Cluster-level tasks on the wrong node. Tasks such as upgrades and etcd backups say which node to SSH to; use sudo -i as instructed, and remember to exit back to the base node.

Practice tasks

Do these on a local cluster (Running a Local Cluster) with a stopwatch. A good CKAD-level task takes about five minutes.

  1. Create a Deployment web with image nginx:1.27, 3 replicas and a readiness probe on port 80; expose it as a ClusterIP Service on port 8080.
  2. Update the image to a new tag, then roll back, and record the revision history.
  3. Create a CronJob that runs every five minutes and keeps three successful Jobs.
  4. Create a ConfigMap and a Secret and mount them in a pod, one as env vars and one as files.
  5. Create a ServiceAccount and a Role so it can only get and list pods; test with auth can-i.
  6. Taint a node and schedule a pod on it with a toleration and a node selector.
  7. Write a NetworkPolicy that allows ingress to db pods only from pods labelled app=api on port 5432.
  8. Break something on purpose (a wrong image tag, a mismatched selector, a too-low memory limit) and diagnose it in under three minutes.
  9. CKA only: take an etcd snapshot, then upgrade a practice cluster by one minor version with kubeadm.
  10. CKS only: make a pod comply with the restricted Pod Security level and block its egress to everything but DNS.

For more scenarios, repeat the Exercises: Scheduling, Security and Troubleshooting lesson without looking at the solutions.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which flag combination makes kubectl print a manifest without creating the object?

    --dry-run=client -o yaml generates the object locally and prints it, which is the base of every imperative generator workflow.
  2. 2. You start a task and realize the cluster context is wrong. What is the best habit?

    Each task names its cluster. Working on the wrong one wastes the effort and scores nothing.
  3. 3. Why rank tasks by points per minute?

    Time is the scarce resource; spend it where each minute earns the most, and flag slow tasks to return to.
  4. 4. Which exam normally requires a valid CKA?

    The CKS candidate must hold a valid CKA; confirm the current rule in the handbook. The CKA and CKAD have no prerequisites.

Summary

  • CKA, CKAD and CKS are hands-on exams in a real terminal; troubleshooting and speed matter most.
  • Set up alias k=kubectl, export do="--dry-run=client -o yaml", completion and a two-space vim profile in the first minute.
  • Generate manifests with k run, k create and k expose ... $do and edit only the missing parts; use k explain and the docs for field names.
  • Always switch context and namespace first, and verify each task before moving on.
  • Rank tasks by points per minute, cap time per task, flag the hard ones and keep a review reserve.
  • Practice on a local cluster with a stopwatch; check the current curriculum and handbook before booking.

Finish with the quick reference in the Kubernetes Cheat Sheet.