CKAD Domain 3: Application Observability and Maintenance
32 free practice questions for Application Observability and Maintenance in the Certified Kubernetes Application Developer (CKAD) exam. Try each question first, then open "Show answer" for the correct option and explanation.
Application Observability and Maintenance practice questions
-
Question 1. Which probe handler runs a command inside the container and treats exit code 0 as success?
Show answer
Answer: B. exec
An exec probe passes when the command exits with 0. Keep it light, because it runs every periodSeconds.
-
Question 2. An httpGet probe receives HTTP 302 from the app. How is it treated?
Show answer
Answer: C. As a success, since codes 200 to 399 pass
Any status code from 200 up to 399 counts as success for an HTTP probe.
-
Question 3. A liveness probe has periodSeconds: 10 and failureThreshold: 3. Roughly how long must the app be unhealthy before the container restarts?
Show answer
Answer: B. About 30 seconds
The kubelet needs 3 consecutive failures, one every 10 seconds, so about 30 seconds.
-
Question 4. What is the default timeoutSeconds for a probe?
Show answer
Answer: A. 1 second
A probe that takes longer than 1 second counts as failed. Slow health endpoints often need a higher timeoutSeconds.
-
Question 5. A startup probe has periodSeconds: 10 and failureThreshold: 30. How long can the app take to start before it's restarted?
Show answer
Answer: C. Up to 300 seconds
The window is failureThreshold × periodSeconds = 300 seconds. Liveness and readiness probes don't run until the startup probe succeeds.
-
Question 6. For which probes must successThreshold be 1?
Show answer
Answer: D. Liveness and startup probes
Readiness probes can require several successes in a row; liveness and startup probes must use 1.
-
Question 7. Which probe should check that the app's dependencies, such as its database, are reachable before it receives traffic?
Show answer
Answer: C. Readiness
A failing readiness probe removes the Pod from Service endpoints without restarting it. Checking dependencies in a liveness probe can restart every replica when the database blips.
-
Question 8. Which probe handler only checks that a port accepts a TCP connection?
Show answer
Answer: D. tcpSocket
tcpSocket passes if a connection to the port succeeds. It doesn't check what the app sends back.
-
Question 9. Which command shows the logs from the previous instance of a container that crashed?
Show answer
Answer: A. kubectl logs web --previous
--previous (-p) reads the terminated container's logs, which usually explain a CrashLoopBackOff.
-
Question 10. Which command prints logs from all Pods with the label app=web?
Show answer
Answer: B. kubectl logs -l app=web
-l takes a label selector. Add --prefix to see which Pod each line came from.
-
Question 11. Which command shows only the last 50 log lines from Pod web?
Show answer
Answer: C. kubectl logs web --tail=50
--tail limits the number of lines. -n is the namespace flag, not a line count.
-
Question 12. Which command shows the logs that Pod web wrote in the last hour?
Show answer
Answer: A. kubectl logs web --since=1h
--since takes a duration such as 10m or 1h; --since-time takes an RFC 3339 timestamp.
-
Question 13. Where should a containerized app write its logs so that kubectl logs shows them?
Show answer
Answer: B. To stdout and stderr
The container runtime captures stdout and stderr. Logs written to files in the container need a sidecar to be collected.
-
Question 14. Which command lists Pods sorted by memory use?
Show answer
Answer: D. kubectl top pod --sort-by=memory
kubectl top reads from the Metrics API (metrics-server) and can sort by cpu or memory.
-
Question 15. Which command shows CPU and memory use for each container within the Pods?
Show answer
Answer: A. kubectl top pod --containers
--containers breaks a Pod's usage down per container.
-
Question 16. Which command lists only the events for Pod web?
Show answer
Answer: C. kubectl get events --field-selector involvedObject.name=web
Events aren't labeled with the Pod's labels; filter on involvedObject fields. kubectl describe pod also shows them.
-
Question 17. Which command adds an ephemeral debug container to running Pod web that can see the processes of container app?
Show answer
Answer: B. kubectl debug -it web --image=busybox --target=app
Ephemeral containers join a running Pod. --target shares the target container's process namespace, so tools like ps work.
-
Question 18. Which command makes a copy of Pod web with an extra debugging container, leaving the original Pod untouched?
Show answer
Answer: D. kubectl debug web -it --image=busybox --copy-to=web-debug
--copy-to creates a new Pod from the original's spec. Add --share-processes to see the other containers' processes.
-
Question 19. Which command watches Pods and prints changes as they happen?
Show answer
Answer: A. kubectl get pods -w
--watch (-w) keeps the request open and prints a line for each change.
-
Question 20. Which command copies /tmp/dump.txt out of Pod web to the local machine?
Show answer
Answer: B. kubectl cp web:/tmp/dump.txt ./dump.txt
kubectl cp uses tar in the container, so the image must include tar.
-
Question 21. Where can a container write a short reason for exiting so that it appears in kubectl describe?
Show answer
Answer: C. /dev/termination-log
This is the default terminationMessagePath. Set terminationMessagePolicy: FallbackToLogsOnError to use the log tail if the file is empty.
-
Question 22. A container's restart count keeps rising, but kubectl logs shows nothing useful. What should you check next?
Show answer
Answer: D. Last State and Events in kubectl describe pod
describe shows the exit code and reason of the last termination (such as OOMKilled or Error) and events such as failing probes.
-
Question 23. After a cluster upgrade, applying a manifest fails with "no matches for kind Deployment in version extensions/v1beta1". What is wrong?
Show answer
Answer: A. The manifest uses an API version that was removed
Deployments moved to apps/v1, and old beta versions were removed. Update apiVersion and any fields that changed.
-
Question 24. Which command lists the API versions the cluster currently serves?
Show answer
Answer: B. kubectl api-versions
kubectl api-versions prints group/version pairs. kubectl api-resources shows each resource and its preferred version.
-
Question 25. Which kubectl plugin rewrites manifests from a deprecated API version to a newer one?
Show answer
Answer: D. kubectl convert
kubectl convert is installed separately as a plugin. For example: kubectl convert -f old.yaml --output-version apps/v1.
-
Question 26. Under the Kubernetes deprecation policy, how long must a deprecated beta API version still be served?
Show answer
Answer: A. 9 months or 3 releases, whichever is longer
Deprecated beta APIs get at least 9 months or 3 releases. GA versions can be deprecated but not removed within a major version.
-
Question 27. How does kubectl show that a request used a deprecated API version?
Show answer
Answer: C. It prints a warning returned by the API server
The API server returns a Warning header, which kubectl prints. The apiserver_requested_deprecated_apis metric tracks this as well.
-
Question 28. Which command blocks until Pod web is Ready, giving up after 60 seconds?
Show answer
Answer: B. kubectl wait --for=condition=Ready pod/web --timeout=60s
kubectl wait exits 0 when the condition is met and non-zero on timeout. rollout status doesn't work on bare Pods.
-
Question 29. Which command documents the fields of a container's livenessProbe?
Show answer
Answer: D. kubectl explain pod.spec.containers.livenessProbe
kubectl explain walks the schema with dotted paths; --recursive prints every nested field.
-
Question 30. A Pod shows CreateContainerConfigError. What is a common cause?
Show answer
Answer: A. A referenced ConfigMap or Secret key doesn't exist
The kubelet can't build the container config, for example when an env var references a missing key. Missing images show ErrImagePull instead.
-
Question 31. Which probe setting delays the first check after the container starts?
Show answer
Answer: C. initialDelaySeconds
initialDelaySeconds waits before the first probe. For slow starts, a startup probe is usually the better tool.
-
Question 32. Which command forwards local port 9090 to port 8080 of Pod web for debugging?
Show answer
Answer: B. kubectl port-forward pod/web 9090:8080
The format is LOCAL:REMOTE. kubectl proxy forwards to the API server, not to Pods.
CKAD, Certified Kubernetes Application Developer, and Kubernetes are trademarks of The Linux Foundation. These questions are original study material, not questions from the real exam.