CKAD · 18 November 2026 · 8 min read

CKAD exam questions: 15 practice tasks with answers

Fifteen CKAD-style practice tasks across all five exam domains, each with a worked answer you can type: Pods, Jobs, rollouts, Helm, probes, ConfigMaps, Secrets, security contexts, Services, Ingress and NetworkPolicies.

The CKAD exam has no multiple-choice questions. Every question is a task you carry out in a real Kubernetes cluster, and a grader checks the result. The best preparation is to work through tasks like the ones below, against the clock, until the commands come without thinking.

TL;DR

  • The CKAD has no multiple choice: every question is a hands-on task in a real cluster, checked by a grader.
  • Below: 15 practice tasks in the exam's style, one section per domain, each with a worked answer.
  • Aim for about six minutes a task, generate YAML with --dry-run=client -o yaml, and check every answer.
  • Always ssh to the host the task names and work in its namespace; work in the wrong place is not found by the grader.
  • These are practice tasks, not leaked exam questions.

These fifteen practice questions follow the style and the five domains of the CKAD. They are not real exam questions: those are confidential, and anyone selling "exam dumps" is breaking the exam rules. What these give you is the same kind of work, with a worked answer for each one. For how the exam itself runs, read How the CKAD exam works.

How to use these questions

  • Give yourself about six minutes per task. Two hours goes quickly across a full set of tasks.
  • Do each task on a real cluster before you read the answer. Reading an answer is not the same as typing it.
  • Generate YAML with --dry-run=client -o yaml rather than writing it from memory.
  • Check your work after every task. In the exam, work on the wrong host or in the wrong namespace is not found by the grader.

Create the namespaces used below first:

Shell
kubectl create namespace appskubectl create namespace team-a

Application Design and Build

Question 1: a Pod with labels

In namespace apps, create a Pod named web using image nginx:1.27, with labels app=web and tier=frontend, exposing container port 80.

Shell
kubectl run web -n apps --image=nginx:1.27 --labels=app=web,tier=frontend --port=80kubectl get pod web -n apps --show-labels

Question 2: an init container

Create a Pod init-demo in apps. An init container (busybox:1.36) writes hello into /work/index.html on an emptyDir volume; the main container (nginx:1.27) mounts the same volume at /usr/share/nginx/html.

YAML
apiVersion: v1kind: Podmetadata:  name: init-demo  namespace: appsspec:  initContainers:  - name: setup    image: busybox:1.36    command: ['sh', '-c', 'echo hello > /work/index.html']    volumeMounts:    - name: html      mountPath: /work  containers:  - name: nginx    image: nginx:1.27    volumeMounts:    - name: html      mountPath: /usr/share/nginx/html  volumes:  - name: html    emptyDir: {}

Check it with kubectl exec -n apps init-demo -c nginx -- cat /usr/share/nginx/html/index.html. More on this pattern in Init containers in Kubernetes; the related sidecar pattern is in Kubernetes sidecar containers.

Question 3: a Job that runs several times

Create a Job count in apps that runs busybox:1.36 with the command echo done. It must complete 3 times, run at most 2 Pods at once, and give up after 4 failures.

Shell
kubectl create job count -n apps --image=busybox:1.36 --dry-run=client -o yaml -- echo done > job.yaml

Edit job.yaml and add three fields under the Job's spec (not the Pod template's):

Shell
spec:  completions: 3  parallelism: 2  backoffLimit: 4
Shell
kubectl apply -f job.yamlkubectl get job count -n apps -w

Question 4: a CronJob

Create a CronJob tick in apps that runs date in busybox:1.36 every five minutes and keeps only the last 2 successful Jobs.

Shell
kubectl create cronjob tick -n apps --image=busybox:1.36 --schedule="*/5 * * * *" -- datekubectl patch cronjob tick -n apps -p '{"spec":{"successfulJobsHistoryLimit":2}}'

To test it without waiting: kubectl create job tick-now -n apps --from=cronjob/tick.

Question 5: persistent storage

Create a PersistentVolumeClaim data in apps requesting 1Gi with access mode ReadWriteOnce, and mount it at /data in a Pod writer.

YAML
apiVersion: v1kind: PersistentVolumeClaimmetadata:  name: data  namespace: appsspec:  accessModes: [ReadWriteOnce]  resources:    requests:      storage: 1Gi---apiVersion: v1kind: Podmetadata:  name: writer  namespace: appsspec:  containers:  - name: writer    image: busybox:1.36    command: ['sh', '-c', 'date > /data/out.txt; sleep 3600']    volumeMounts:    - name: data      mountPath: /data  volumes:  - name: data    persistentVolumeClaim:      claimName: data

If the task names a StorageClass, add storageClassName. Check that the claim is Bound with kubectl get pvc -n apps.

Application Deployment

Question 6: rolling update and rollback

Create a Deployment shop in apps with 3 replicas of nginx:1.26. Update it to nginx:1.27, then roll back to the previous version.

Shell
kubectl create deployment shop -n apps --image=nginx:1.26 --replicas=3kubectl set image deployment/shop -n apps nginx=nginx:1.27kubectl rollout status deployment/shop -n appskubectl rollout history deployment/shop -n appskubectl rollout undo deployment/shop -n apps

The container is called nginx because kubectl create deployment names it after the image. Check with kubectl get deploy shop -n apps -o jsonpath='{.spec.template.spec.containers[0].image}'.

Question 7: a canary release

A Service shop selects Pods with app=shop. Add a canary Deployment shop-canary running nginx:1.27 so that roughly 20% of traffic goes to it.

Both Deployments need the shared label app=shop on their Pods. With 4 stable replicas and 1 canary replica, the Service spreads requests across 5 Pods, so about one in five hit the canary:

Shell
kubectl expose deployment shop -n apps --port=80    # skip if the Service already existskubectl scale deployment shop -n apps --replicas=4kubectl create deployment shop-canary -n apps --image=nginx:1.27 --replicas=1 --dry-run=client -o yaml > canary.yaml

In canary.yaml, set the Pod template labels and selector to app: shop plus track: canary, then apply it. Check that the Service now has 5 endpoints:

Shell
kubectl get endpointslices -n apps -l kubernetes.io/service-name=shop

Question 8: Helm

A Helm release web is installed in namespace team-a. Find its chart, set replicaCount to 2, and roll back if the upgrade fails.

Shell
helm list -n team-ahelm get values web -n team-ahelm upgrade web <repo>/<chart> -n team-a --reuse-values --set replicaCount=2helm history web -n team-ahelm rollback web 1 -n team-a

The CHART column of helm list tells you which chart and version the release uses. Without --reuse-values, an upgrade drops any values set earlier.

Application Observability and Maintenance

Question 9: readiness and liveness probes

Add a readiness probe to the container in Deployment api that calls GET /healthz on port 8080 every 10 seconds, and a liveness probe that runs cat /tmp/healthy.

Shell
kubectl edit deployment api -n apps
Shell
        readinessProbe:          httpGet:            path: /healthz            port: 8080          periodSeconds: 10        livenessProbe:          exec:            command: ['cat', '/tmp/healthy']          initialDelaySeconds: 5

Use kubectl explain pod.spec.containers.readinessProbe if you forget a field name.

Question 10: fix a broken Deployment

Deployment broken in apps has no ready Pods. Find out why and fix it.

Shell
kubectl get pods -n apps -l app=brokenkubectl describe pod -n apps -l app=broken | tail -20kubectl get events -n apps --sort-by=.lastTimestamp | tailkubectl logs -n apps deploy/broken --previous

The status column points to the cause: ImagePullBackOff means a wrong image name or tag (fix with kubectl set image), CrashLoopBackOff means the app is exiting (read the logs), and Pending means the Pod cannot be scheduled (read the events: often resources or a node selector).

Application Environment, Configuration and Security

Question 11: ConfigMap and Secret as environment variables

Create a ConfigMap app-config with MODE=prod and a Secret db-cred with PASSWORD=s3cret. Load all of the ConfigMap as environment variables, and the Secret's key as DB_PASSWORD, in a Pod configured.

Shell
kubectl create configmap app-config -n apps --from-literal=MODE=prodkubectl create secret generic db-cred -n apps --from-literal=PASSWORD=s3cret
Shell
  containers:  - name: app    image: busybox:1.36    command: ['sh', '-c', 'env; sleep 3600']    envFrom:    - configMapRef:        name: app-config    env:    - name: DB_PASSWORD      valueFrom:        secretKeyRef:          name: db-cred          key: PASSWORD

Check with kubectl exec -n apps configured -- env | grep -E 'MODE|DB_PASSWORD'.

Question 12: security context

Make the container in Pod secure run as user 1000, with a read-only root filesystem and no privilege escalation.

Shell
  containers:  - name: app    image: busybox:1.36    command: ['sleep', '3600']    securityContext:      runAsUser: 1000      readOnlyRootFilesystem: true      allowPrivilegeEscalation: false

Check with kubectl exec -n apps secure -- id (uid 1000) and kubectl exec -n apps secure -- touch /x (fails: read-only).

Question 13: requests, limits and a quota

Give Deployment shop requests of 100m CPU and 128Mi memory and limits of 200m and 256Mi. Then limit namespace team-a to 10 Pods and 2 CPUs of requests.

Shell
kubectl set resources deployment shop -n apps --requests=cpu=100m,memory=128Mi --limits=cpu=200m,memory=256Mikubectl create quota team-quota -n team-a --hard=pods=10,requests.cpu=2kubectl describe quota team-quota -n team-a

Once a quota covers CPU requests, every new Pod in that namespace must set a CPU request, or it is rejected. A LimitRange can supply defaults.

Question 14: a ServiceAccount

Create a ServiceAccount shop-sa in apps and make Deployment shop use it.

Shell
kubectl create serviceaccount shop-sa -n appskubectl set serviceaccount deployment shop shop-sa -n appskubectl get deploy shop -n apps -o jsonpath='{.spec.template.spec.serviceAccountName}'

Services and Networking

Question 15: Service, Ingress and NetworkPolicy

Expose Deployment shop on a ClusterIP Service shop-svc port 80. Route shop.example.com to it with an Ingress. Then allow only Pods labeled app=api to reach Pods labeled app=db on TCP 5432.

Shell
kubectl expose deployment shop -n apps --name=shop-svc --port=80 --target-port=80kubectl create ingress shop -n apps --rule="shop.example.com/*=shop-svc:80"
YAML
apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:  name: db-from-api  namespace: appsspec:  podSelector:    matchLabels:      app: db  policyTypes: [Ingress]  ingress:  - from:    - podSelector:        matchLabels:          app: api    ports:    - protocol: TCP      port: 5432

The /* in the Ingress rule gives a Prefix path; without it the path is Exact. If the cluster has more than one Ingress controller, add --class. Read Network policies explained for how from rules combine.

Checking your answers

After each task, ask the question the grader asks: does the object exist, in the right namespace and context, with the right fields? kubectl get <kind> <name> -n <ns> -o yaml shows everything. A quick set of kubectl aliases makes these checks fast enough to do every time.

Keep going

The Gazeek CKAD course turns tasks like these into labs on a real Kubernetes cluster built for you, covering every domain of the exam guide, with checks that tell you whether your answer is right. The CKAD exam guide maps each domain to what to practice, and the free Gazeek Memory Gym keeps commands and field names fresh between labs.

More from the blog