Cloud Native Computing Foundation logo

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.

CKADAdvanced

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?

  1. A.A ReplicaSet with `spec.replicas: 1` and an `activeDeadlineSeconds` of 4
  2. B.A Job with `spec.backoffLimit: 4` and `spec.template.spec.restartPolicy: OnFailure`
  3. C.A Deployment with `spec.replicas: 1` and `spec.template.spec.restartPolicy: OnFailure`
  4. 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?

  1. A.`kubectl rollout pause deployment/beacon-web`
  2. B.`kubectl delete deployment/beacon-web --cascade=orphan`
  3. C.`kubectl rollout undo deployment/beacon-web`
  4. 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?

  1. A.Add a `startupProbe` with a generous `failureThreshold` × `periodSeconds` budget; liveness checks begin only after it succeeds
  2. B.Set the liveness probe's `successThreshold` to 9
  3. C.Add a readiness probe with `initialDelaySeconds: 90` and remove the liveness probe
  4. 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?

  1. A.```yaml envFrom: - secretKeyRef: name: db-creds key: password ```
  2. B.```yaml env: - name: DB_PASSWORD secret: db-creds/password ```
  3. C.```yaml env: - name: DB_PASSWORD valueFrom: configMapKeyRef: name: db-creds key: password ```
  4. 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?

  1. A.A ClusterIP Service with `selector: {app: bellhaven, tier: api}` and `ports: [{port: 9000, targetPort: 80}]`
  2. B.A headless Service with `clusterIP: None` and `ports: [{port: 80}]`
  3. C.A NodePort Service with `ports: [{port: 80, nodePort: 9000}]`
  4. 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?

  1. A.`spec.suspend: true`
  2. B.`spec.concurrencyPolicy: Forbid`
  3. C.`spec.startingDeadlineSeconds: 0`
  4. 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?

  1. A.`maxUnavailable: 2` and `maxSurge: 2`
  2. B.`maxUnavailable: 2` and `maxSurge: 0`
  3. C.`type: Recreate` with `maxSurge: 2`
  4. 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?

  1. A.`kubectl logs ashcombe-worker --since=0s`
  2. B.`kubectl logs ashcombe-worker --previous`
  3. C.`kubectl logs ashcombe-worker --tail=-1`
  4. 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 →

All questions are original — never reproduced from the real exam — and pass automated duplicate, citation and item-writing checks before publication. See how our exams are made.

Kwizza is an independent study tool and is not affiliated with, endorsed by, or sponsored by Cloud Native Computing Foundation. Cloud Native Computing Foundation names, logos and certification marks are the property of their respective owners and are used here only to identify the exam described. Practice questions are original, written against the publicly published exam objectives — no real exam content is reproduced.