Certified Kubernetes Application Developer (CKAD) practice questions
8 sample questions from our 300-question CKAD bank — one from each official domain, with the answer and a full explanation under each. Every question is original, written against the published exam objectives, and quality-checked before it reaches you.
Question 1 · Application Design and Build
A developer at Thornbury Logistics packages a report generator that must run once, write a CSV to object storage, and exit. If the container exits non-zero, Kubernetes should retry it up to 4 times before giving up. Which workload object and field combination satisfies this?
- A.A ReplicaSet with `spec.replicas: 1` and an `activeDeadlineSeconds` of 4
- B.A Job with `spec.backoffLimit: 4` and `spec.template.spec.restartPolicy: OnFailure`
- C.A Deployment with `spec.replicas: 1` and `spec.template.spec.restartPolicy: OnFailure`
- D.A CronJob with `spec.schedule: "@once"` and `spec.failedJobsHistoryLimit: 4`
Show answer & explanation
Answer: B
A Job is the run-to-completion primitive, and `backoffLimit` caps how many times the Job controller retries before marking the Job Failed. A Deployment is wrong because its pod template only accepts `restartPolicy: Always`, so the pod would be restarted forever rather than completing.
Question 2 · Application Deployment
After running `kubectl set image deployment/beacon-web web=beacon:5.2`, a developer sees the rollout stall with 3 of 6 pods updated. She wants to return to the previously running revision immediately. Which command does this?
- A.`kubectl rollout pause deployment/beacon-web`
- B.`kubectl delete deployment/beacon-web --cascade=orphan`
- C.`kubectl rollout undo deployment/beacon-web`
- D.`kubectl scale deployment/beacon-web --replicas=0`
Show answer & explanation
Answer: C
`kubectl rollout undo` rolls the Deployment back to the prior revision recorded in its ReplicaSet history, restoring the working pod template. Pausing only freezes the rollout mid-flight and leaves the broken pods in place.
Question 3 · Application Observability and Maintenance
A container in the `dunmore-gateway` pod takes about 90 seconds to warm its cache at boot, and the team does not want a liveness probe killing it during that window, while still keeping a 10-second liveness check afterwards. What is the cleanest configuration?
- A.Add a `startupProbe` with a generous `failureThreshold` × `periodSeconds` budget; liveness checks begin only after it succeeds
- B.Set the liveness probe's `successThreshold` to 9
- C.Add a readiness probe with `initialDelaySeconds: 90` and remove the liveness probe
- D.Set the liveness probe's `timeoutSeconds` to 90
Show answer & explanation
Answer: A
A startup probe suspends liveness and readiness checks until the container reports it has started, which is the purpose-built answer for slow-starting apps. Raising `timeoutSeconds` only extends how long a single probe request may take, not how long the app may take to become healthy.
Question 4 · Application Environment, Configuration and Security
The `kingsmere-api` container must read a database password from a Secret named `db-creds` (key `password`) as the environment variable `DB_PASSWORD`. Which snippet is correct?
- A.```yaml envFrom: - secretKeyRef: name: db-creds key: password ```
- B.```yaml env: - name: DB_PASSWORD secret: db-creds/password ```
- C.```yaml env: - name: DB_PASSWORD valueFrom: configMapKeyRef: name: db-creds key: password ```
- D.```yaml env: - name: DB_PASSWORD valueFrom: secretKeyRef: name: db-creds key: password ```
Show answer & explanation
Answer: D
A single Secret key is injected with `valueFrom.secretKeyRef`, naming both the Secret and the key. `envFrom` takes a `secretRef` and imports every key using the key names as variable names, so it accepts no `key` field and cannot rename the variable.
Question 5 · Services and Networking
The `bellhaven-api` Deployment has 4 pods labeled `app=bellhaven,tier=api` listening on container port 9000. Other pods in the cluster must reach it at `bellhaven-api:80`. Which Service definition works?
- A.A ClusterIP Service with `selector: {app: bellhaven, tier: api}` and `ports: [{port: 9000, targetPort: 80}]`
- B.A headless Service with `clusterIP: None` and `ports: [{port: 80}]`
- C.A NodePort Service with `ports: [{port: 80, nodePort: 9000}]`
- D.A ClusterIP Service with `selector: {app: bellhaven, tier: api}` and `ports: [{port: 80, targetPort: 9000}]`
Show answer & explanation
Answer: D
`port` is what the Service listens on and `targetPort` is the container port traffic is forwarded to, so 80 to 9000 is the correct direction. Reversing them would publish the Service on 9000 and forward to a port nothing is bound to.
Question 6 · Application Design and Build
The `invoice-sweeper` CronJob at Calder Mutual is scheduled every 5 minutes, but each run occasionally takes 12 minutes. The team wants a late run to be skipped entirely if the previous one is still going. Which field setting achieves that?
- A.`spec.suspend: true`
- B.`spec.concurrencyPolicy: Forbid`
- C.`spec.startingDeadlineSeconds: 0`
- D.`spec.concurrencyPolicy: Replace`
Show answer & explanation
Answer: B
`Forbid` tells the CronJob controller to skip a scheduled run while a prior Job from the same CronJob is still active. `Replace` would instead terminate the running Job and start a fresh one, which would abort work already in progress.
Question 7 · Application Deployment
The `harlow-frontend` Deployment runs 10 replicas. Operations requires that during an update the service never drops below full capacity, and no more than 2 extra pods exist at any moment. Which strategy block matches?
- A.`maxUnavailable: 2` and `maxSurge: 2`
- B.`maxUnavailable: 2` and `maxSurge: 0`
- C.`type: Recreate` with `maxSurge: 2`
- D.`maxUnavailable: 0` and `maxSurge: 2`
Show answer & explanation
Answer: D
`maxUnavailable: 0` guarantees ten pods stay Ready throughout, and `maxSurge: 2` caps the temporary overshoot at twelve. Setting `maxUnavailable: 2` would allow capacity to dip to eight, violating the stated requirement.
Question 8 · Application Observability and Maintenance
`kubectl get pod ashcombe-worker` reports `CrashLoopBackOff` with 6 restarts. The current container has already restarted, so its logs show only the newest attempt. Which command shows output from the attempt that crashed?
- A.`kubectl logs ashcombe-worker --since=0s`
- B.`kubectl logs ashcombe-worker --previous`
- C.`kubectl logs ashcombe-worker --tail=-1`
- D.`kubectl describe pod ashcombe-worker --show-events=all`
Show answer & explanation
Answer: B
`--previous` (`-p`) retrieves the log stream of the container instance that terminated before the current one, which is where the crash reason appears. `--tail=-1` only changes how many lines of the current instance are shown.
292+ more questions, free
Full-length, timed or practice mode, weighted to the official blueprint — with per-domain scoring so you know exactly where you stand.
Start the full practice exam →