CKA Domain 5: Troubleshooting
61 free practice questions for Troubleshooting in the Certified Kubernetes Administrator (CKA) exam. Try each question first, then open "Show answer" for the correct option and explanation.
Troubleshooting practice questions
-
Question 1. A Pod is stuck in Pending. Which command shows the scheduler's reason?
Show answer
Answer: C. kubectl describe pod POD_NAME, then read Events
Events show messages such as insufficient CPU or untolerated taints. Pending Pods have no container logs.
-
Question 2. A Pod is in ImagePullBackOff. What is the MOST likely cause?
Show answer
Answer: C. A wrong image name or tag, or missing pull credentials
Check the image reference and imagePullSecrets for private registries.
-
Question 3. A Pod shows CrashLoopBackOff. What is the best first step?
Show answer
Answer: C. Check its logs (with --previous) and describe it
CrashLoopBackOff means the container keeps exiting. Logs and the exit code usually show why.
-
Question 4. A container status shows OOMKilled. What is the fix?
Show answer
Answer: C. Raise the memory limit or reduce memory use
The container exceeded its memory limit and was killed by the kernel.
-
Question 5. A node shows NotReady. Which service should be checked FIRST on that node?
Show answer
Answer: D. The kubelet service and its journal logs
The kubelet reports node status. If it's stopped or failing, the node becomes NotReady.
-
Question 6. The kubelet on a node fails to start after a config change. Where are its logs usually found?
Show answer
Answer: B. journalctl -u kubelet
The kubelet runs as a systemd service, not as a Pod, so its logs are in the journal.
-
Question 7. kubectl commands fail with "connection refused" to the API server on a kubeadm cluster. What should be checked?
Show answer
Answer: A. The kube-apiserver static Pod and its manifest
Use crictl ps and crictl logs on the control plane node, since kubectl can't reach the API.
-
Question 8. Which tool inspects containers directly on a node through the CRI, even when the API server is down?
Show answer
Answer: C. crictl
crictl ps, crictl logs, and crictl pods work against containerd or CRI-O.
-
Question 9. A typo was introduced in /etc/kubernetes/manifests/kube-scheduler.yaml. What happens?
Show answer
Answer: A. The scheduler static Pod fails, and new Pods stay Pending
Without a scheduler, new Pods aren't assigned to nodes. Running Pods keep running.
-
Question 10. New Deployments create no ReplicaSets or Pods, though the API accepts them. Which component is likely failing?
Show answer
Answer: D. kube-controller-manager
The Deployment controller in the controller manager creates ReplicaSets, which create Pods.
-
Question 11. Which command shows CPU and memory usage of Pods?
Show answer
Answer: D. kubectl top pods
kubectl top needs the metrics server installed.
-
Question 12. kubectl top fails with "Metrics API not available". What is needed?
Show answer
Answer: C. Install and run the metrics-server
The metrics server serves the resource metrics API used by kubectl top and HPA.
-
Question 13. Which command shows the logs of a specific container in a multi-container Pod?
Show answer
Answer: D. kubectl logs POD_NAME -c CONTAINER_NAME
-c selects the container. --all-containers shows logs from all of them.
-
Question 14. Which command streams a Pod's logs as they are written?
Show answer
Answer: C. kubectl logs -f POD_NAME
-f follows the log stream, like tail -f.
-
Question 15. Where does the kubelet store container log files on a node?
Show answer
Answer: C. /var/log/pods and /var/log/containers
kubectl logs reads these files through the kubelet. Log rotation is handled by the kubelet.
-
Question 16. Which command lists recent events across the cluster sorted by time?
Show answer
Answer: A. kubectl get events -A --sort-by=.metadata.creationTimestamp
Events explain scheduling, pulling, probe failures, and more. They expire after about an hour by default.
-
Question 17. Which command opens a shell in a running container to troubleshoot?
Show answer
Answer: B. kubectl exec -it POD_NAME -- sh
exec runs a command in an existing container. The image must include a shell.
-
Question 18. A container image has no shell. How can you troubleshoot inside the Pod?
Show answer
Answer: D. Use kubectl debug to add an ephemeral debug container
Ephemeral containers share the Pod's namespaces and can bring their own tools.
-
Question 19. Which command starts a debugging Pod on a node with access to the node's filesystem?
Show answer
Answer: A. kubectl debug node/node1 -it --image=busybox
The node's root filesystem is mounted at /host in the debug Pod.
-
Question 20. A Service works by Pod IP but not by Service IP. What should be checked?
Show answer
Answer: B. kube-proxy and the Service's port mapping
If Pods respond directly, the issue is often kube-proxy rules or a port mismatch in the Service.
-
Question 21. Pods on node1 can't reach Pods on node2, but same-node traffic works. What is the likely cause?
Show answer
Answer: B. The CNI plugin is misconfigured or its Pods are failing
Cross-node Pod traffic depends on the CNI's overlay or routing, so check the CNI DaemonSet Pods and logs.
-
Question 22. A Pod is Running but not Ready. What is the most likely reason?
Show answer
Answer: B. Its readiness probe is failing
Running means containers have started. Ready means they pass readiness checks and can receive traffic.
-
Question 23. A Pod has been Terminating for a long time. Which command removes it immediately?
Show answer
Answer: D. kubectl delete pod POD_NAME --grace-period=0 --force
Force deletion removes the object from the API. Check that the process really stopped on the node.
-
Question 24. Which kubectl output format is best for finding a specific field quickly, such as a Pod's node?
Show answer
Answer: A. -o jsonpath or -o wide
-o wide shows node and IP. JSONPath extracts precise fields.
-
Question 25. A Deployment's Pods keep being evicted from a node with DiskPressure. What should be investigated?
Show answer
Answer: D. What is filling the node's disk
Node pressure conditions trigger evictions. Clean up disk or add capacity.
-
Question 26. The API server can't reach etcd after a certificate rotation. Where should you look?
Show answer
Answer: B. The etcd certificate flags in the API server manifest
Mismatched --etcd-cafile, --etcd-certfile, or --etcd-keyfile values break the connection.
-
Question 27. Which exit code in a container status often means the process was killed with SIGKILL?
Show answer
Answer: C. 137
137 is 128 + 9 (SIGKILL), often from OOM or a failed graceful shutdown. 127 means command not found.
-
Question 28. A container exits with code 127. What does this typically mean?
Show answer
Answer: C. The command or entrypoint was not found
Check the command and args in the Pod spec and the image's contents.
-
Question 29. A Pod can resolve external names but not cluster Service names. What should be checked?
Show answer
Answer: D. The Pod's dnsPolicy and resolv.conf search domains
With dnsPolicy Default, the Pod uses the node's DNS and can't resolve cluster names.
-
Question 30. Which command shows resource requests and allocations for a node?
Show answer
Answer: C. kubectl describe node node1
The Allocated resources section shows requested CPU and memory compared with capacity.
-
Question 31. Which kubectl command lists Pods with their node and IP?
Show answer
Answer: C. kubectl get pods -o wide
The wide output adds IP, node, and more columns.
-
Question 32. A Deployment was scaled to 5 replicas but only 3 run. Events show "exceeded quota". What limits it?
Show answer
Answer: A. A ResourceQuota in the namespace
When the quota is used up, new Pods are rejected until resources are freed or the quota is raised.
-
Question 33. Why might a Pod fail with "0/3 nodes are available: 3 node(s) had untolerated taint"?
Show answer
Answer: B. All nodes have taints the Pod doesn't tolerate
Add a toleration or remove the taint, depending on intent.
-
Question 34. What does "Insufficient cpu" in a Pending Pod's events mean?
Show answer
Answer: D. No node has enough unrequested CPU for the Pod's requests
Scheduling uses requests. Lower the requests, free capacity, or add nodes.
-
Question 35. Where can you check whether CoreDNS is failing?
Show answer
Answer: C. kubectl logs -n kube-system -l k8s-app=kube-dns
CoreDNS Pods use the k8s-app=kube-dns label for compatibility.
-
Question 36. A new node joined but stays NotReady with "network plugin not ready". What is needed?
Show answer
Answer: A. A running CNI Pod and config in /etc/cni/net.d
Check the CNI DaemonSet Pod on that node and the CNI configuration directory.
-
Question 37. An Ingress returns 503 errors. What is a likely cause?
Show answer
Answer: C. The backend Service has no ready endpoints
The Ingress controller can't forward requests if no healthy Pods back the Service.
-
Question 38. A container keeps restarting because its liveness probe fails during slow startup. What should be changed?
Show answer
Answer: A. Add a startup probe or increase initialDelaySeconds
The probe must allow enough time for the application to start.
-
Question 39. How can you see why a container last terminated?
Show answer
Answer: B. kubectl describe pod, then check Last State
Last State shows the reason, such as Error or OOMKilled, and the exit code.
-
Question 40. A worker's kubelet logs show "x509: certificate has expired". What should be done?
Show answer
Answer: D. Renew the kubelet's client certificate
The kubelet needs a valid certificate to authenticate to the API server.
-
Question 41. Which command checks the health of the etcd cluster with TLS?
Show answer
Answer: D. etcdctl endpoint health, with the TLS flags
etcdctl endpoint health (and endpoint status) report whether members respond.
-
Question 42. An application in a Pod can't connect to a database Service in another namespace. DNS works. What else could block it?
Show answer
Answer: D. A NetworkPolicy in the database namespace
Policies often allow only same-namespace traffic. Check policies on both sides for ingress and egress.
-
Question 43. Which command confirms which image a Deployment is currently running?
Show answer
Answer: B. kubectl get deploy web -o jsonpath='{..image}'
JSONPath extracts the image field. kubectl describe deployment also shows it.
-
Question 44. A node's disk is full of unused images. What reclaims space safely?
Show answer
Answer: C. Image garbage collection or crictl rmi --prune
Image GC removes unused images when disk usage crosses thresholds.
-
Question 45. Which command shows the most recent failed Job's Pod logs?
Show answer
Answer: C. kubectl logs job/JOB_NAME
kubectl logs job/NAME picks one of the Job's Pods. Use a label selector to see others.
-
Question 46. Why should you verify the context before changing resources during troubleshooting?
Show answer
Answer: B. kubectl may be pointed at a different cluster or namespace
Running commands against the wrong cluster is a common and costly mistake.
-
Question 47. A Pod's container is running but the app returns errors. Which command helps inspect environment variables inside it?
Show answer
Answer: C. kubectl exec POD_NAME -- env
env shows the variables the process actually received, which helps catch missing configuration.
-
Question 48. Which log output helps diagnose why a node's kubelet can't pull an image from a private registry?
Show answer
Answer: A. The Pod's events, showing an auth error
Missing or wrong imagePullSecrets show up as unauthorized errors in the events.
-
Question 49. What does kubectl get componentstatuses (deprecated) show, and what's a better alternative?
Show answer
Answer: B. Control plane health; check kube-system Pods and /readyz instead
The API server's /livez and /readyz endpoints and the control plane Pod statuses give reliable health.
-
Question 50. Which API server endpoint reports whether it's ready to serve requests?
Show answer
Answer: C. /readyz
/livez and /readyz are the current health endpoints. /healthz is deprecated.
-
Question 51. A Deployment rollout is stuck. Which command shows its progress?
Show answer
Answer: A. kubectl rollout status deployment/web
rollout status waits and reports whether the rollout completed or stalled.
-
Question 52. What is the purpose of a PodDisruptionBudget during troubleshooting and maintenance?
Show answer
Answer: C. It limits voluntary evictions, such as drains, to keep enough replicas running
A PDB can block a drain if evicting another Pod would drop below its minimum.
-
Question 53. A drain hangs on one Pod. What is a likely cause?
Show answer
Answer: A. A PodDisruptionBudget prevents the eviction
Check the PDB's allowed disruptions. Scale up the workload or adjust the budget.
-
Question 54. Which command shows the full YAML of a live Pod, including status fields?
Show answer
Answer: C. kubectl get pod POD_NAME -o yaml
The live object includes status, conditions, and container states.
-
Question 55. Which Pod condition shows that all containers have started and passed readiness?
Show answer
Answer: B. Ready
Ready is required before a Pod is added to Service endpoints.
-
Question 56. An init container keeps failing. What status does the Pod show?
Show answer
Answer: C. Init:CrashLoopBackOff
App containers don't start until all init containers succeed. Check the init container's logs with -c.
-
Question 57. Which command shows only the Pods not in the Running phase in all namespaces?
Show answer
Answer: D. kubectl get pods -A --field-selector=status.phase!=Running
Field selectors filter by fields such as status.phase and spec.nodeName.
-
Question 58. After fixing a static Pod manifest on a control plane node, what must be done?
Show answer
Answer: D. Nothing; the kubelet recreates the Pod
The kubelet watches the manifests directory and restarts static Pods automatically.
-
Question 59. How can you confirm a Pod has the environment variable from a Secret without printing the Secret?
Show answer
Answer: C. Check the Pod spec for the secretKeyRef, then test the app behavior
Avoid exposing secret values. Verify references and behavior instead.
-
Question 60. A PVC is bound, but the Pod fails to start with a mount error. Where is the most useful information?
Show answer
Answer: C. The Pod's events and the node's CSI or kubelet logs
Mount failures show in events, with details in the CSI node plugin and kubelet logs.
-
Question 61. Why is it useful to set --dry-run=client -o yaml with kubectl create?
Show answer
Answer: B. It generates a manifest you can edit before applying
This is a fast way to create correct YAML during the exam.
CKA, Certified Kubernetes Administrator, and Kubernetes are trademarks of The Linux Foundation. These questions are original study material, not questions from the real exam.