CKA · Domain 5 of 5 · 30% of the exam

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

  1. Question 1. A Pod is stuck in Pending. Which command shows the scheduler's reason?

    1. kubectl logs POD_NAME --previous --all-containers
    2. kubectl exec POD_NAME -- ps aux
    3. kubectl describe pod POD_NAME, then read Events
    4. kubectl top pod POD_NAME --containers
    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.

  2. Question 2. A Pod is in ImagePullBackOff. What is the MOST likely cause?

    1. The node has no free memory for the container
    2. The container's readiness probe is failing
    3. A wrong image name or tag, or missing pull credentials
    4. The Service in front of the Pod has no endpoints
    Show answer

    Answer: C. A wrong image name or tag, or missing pull credentials

    Check the image reference and imagePullSecrets for private registries.

  3. Question 3. A Pod shows CrashLoopBackOff. What is the best first step?

    1. Delete the node the Pod is running on
    2. Restart the API server on the control plane
    3. Check its logs (with --previous) and describe it
    4. Delete and recreate the Pod's namespace
    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.

  4. Question 4. A container status shows OOMKilled. What is the fix?

    1. Increase the container's CPU limit
    2. Change the Service type to NodePort
    3. Raise the memory limit or reduce memory use
    4. Add a readiness probe to the container
    Show answer

    Answer: C. Raise the memory limit or reduce memory use

    The container exceeded its memory limit and was killed by the kernel.

  5. Question 5. A node shows NotReady. Which service should be checked FIRST on that node?

    1. The etcd service running on the node
    2. The kube-scheduler Pod on the node
    3. The CoreDNS Pod running on the node
    4. The kubelet service and its journal logs
    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.

  6. Question 6. The kubelet on a node fails to start after a config change. Where are its logs usually found?

    1. kubectl logs kubelet -n kube-system
    2. journalctl -u kubelet
    3. /var/log/pods/kubelet.log only
    4. kubectl describe node kubelet
    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.

  7. Question 7. kubectl commands fail with "connection refused" to the API server on a kubeadm cluster. What should be checked?

    1. The kube-apiserver static Pod and its manifest
    2. The CoreDNS ConfigMap in kube-system
    3. The Ingress controller's logs
    4. The list of PersistentVolumes
    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.

  8. Question 8. Which tool inspects containers directly on a node through the CRI, even when the API server is down?

    1. kubectl
    2. helm
    3. crictl
    4. kustomize
    Show answer

    Answer: C. crictl

    crictl ps, crictl logs, and crictl pods work against containerd or CRI-O.

  9. Question 9. A typo was introduced in /etc/kubernetes/manifests/kube-scheduler.yaml. What happens?

    1. The scheduler static Pod fails, and new Pods stay Pending
    2. Existing Pods are deleted immediately
    3. The API server rejects all requests
    4. The kubelet stops on all nodes
    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.

  10. Question 10. New Deployments create no ReplicaSets or Pods, though the API accepts them. Which component is likely failing?

    1. kube-scheduler
    2. kube-proxy
    3. CoreDNS
    4. kube-controller-manager
    Show answer

    Answer: D. kube-controller-manager

    The Deployment controller in the controller manager creates ReplicaSets, which create Pods.

  11. Question 11. Which command shows CPU and memory usage of Pods?

    1. kubectl describe pods --usage
    2. kubectl get pods -o metrics
    3. kubectl logs --metrics
    4. kubectl top pods
    Show answer

    Answer: D. kubectl top pods

    kubectl top needs the metrics server installed.

  12. Question 12. kubectl top fails with "Metrics API not available". What is needed?

    1. Enable the Ingress controller
    2. Restart CoreDNS
    3. Install and run the metrics-server
    4. Create a StorageClass
    Show answer

    Answer: C. Install and run the metrics-server

    The metrics server serves the resource metrics API used by kubectl top and HPA.

  13. Question 13. Which command shows the logs of a specific container in a multi-container Pod?

    1. kubectl logs POD_NAME --all
    2. kubectl describe container CONTAINER_NAME
    3. kubectl exec POD_NAME -- logs
    4. kubectl logs POD_NAME -c CONTAINER_NAME
    Show answer

    Answer: D. kubectl logs POD_NAME -c CONTAINER_NAME

    -c selects the container. --all-containers shows logs from all of them.

  14. Question 14. Which command streams a Pod's logs as they are written?

    1. kubectl logs --watch-all POD_NAME
    2. kubectl get logs POD_NAME -w
    3. kubectl logs -f POD_NAME
    4. kubectl attach --logs POD_NAME
    Show answer

    Answer: C. kubectl logs -f POD_NAME

    -f follows the log stream, like tail -f.

  15. Question 15. Where does the kubelet store container log files on a node?

    1. /etc/kubernetes/logs and /etc/kubernetes/pki
    2. /var/lib/etcd/logs and /var/lib/etcd/member
    3. /var/log/pods and /var/log/containers
    4. /root/.kube/logs and /root/.kube/cache
    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.

  16. Question 16. Which command lists recent events across the cluster sorted by time?

    1. kubectl get events -A --sort-by=.metadata.creationTimestamp
    2. kubectl describe events -A --sort-by=time --all-namespaces
    3. kubectl logs events -A --since=1h --timestamps=true
    4. kubectl top events -A --sort-by=creationTimestamp
    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.

  17. Question 17. Which command opens a shell in a running container to troubleshoot?

    1. kubectl attach POD_NAME --shell
    2. kubectl exec -it POD_NAME -- sh
    3. kubectl run POD_NAME -- sh
    4. kubectl debug node POD_NAME
    Show answer

    Answer: B. kubectl exec -it POD_NAME -- sh

    exec runs a command in an existing container. The image must include a shell.

  18. Question 18. A container image has no shell. How can you troubleshoot inside the Pod?

    1. Rebuild the node's operating system
    2. Use kubectl exec with --force
    3. Restart the Pod with hostNetwork
    4. Use kubectl debug to add an ephemeral debug container
    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.

  19. Question 19. Which command starts a debugging Pod on a node with access to the node's filesystem?

    1. kubectl debug node/node1 -it --image=busybox
    2. kubectl exec node/node1 -- sh
    3. kubectl run debug --node node1 --host
    4. kubectl attach node/node1
    Show answer

    Answer: A. kubectl debug node/node1 -it --image=busybox

    The node's root filesystem is mounted at /host in the debug Pod.

  20. Question 20. A Service works by Pod IP but not by Service IP. What should be checked?

    1. The Pod's liveness probe settings
    2. kube-proxy and the Service's port mapping
    3. The PersistentVolume reclaim policy
    4. The Helm release history for the app
    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.

  21. Question 21. Pods on node1 can't reach Pods on node2, but same-node traffic works. What is the likely cause?

    1. The kube-scheduler is not running
    2. The CNI plugin is misconfigured or its Pods are failing
    3. The Deployment has too many replicas
    4. The PVC is not bound
    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.

  22. Question 22. A Pod is Running but not Ready. What is the most likely reason?

    1. Its image failed to pull
    2. Its readiness probe is failing
    3. It has no node assigned
    4. Its namespace was deleted
    Show answer

    Answer: B. Its readiness probe is failing

    Running means containers have started. Ready means they pass readiness checks and can receive traffic.

  23. Question 23. A Pod has been Terminating for a long time. Which command removes it immediately?

    1. kubectl stop pod POD_NAME --now --grace-period=0
    2. kubectl drain pod POD_NAME --force --delete-local
    3. kubectl cordon pod POD_NAME --force --immediate
    4. kubectl delete pod POD_NAME --grace-period=0 --force
    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.

  24. Question 24. Which kubectl output format is best for finding a specific field quickly, such as a Pod's node?

    1. -o jsonpath or -o wide
    2. -o yaml piped to /dev/null
    3. --dry-run=client
    4. --show-kind only
    Show answer

    Answer: A. -o jsonpath or -o wide

    -o wide shows node and IP. JSONPath extracts precise fields.

  25. Question 25. A Deployment's Pods keep being evicted from a node with DiskPressure. What should be investigated?

    1. The CPU limits of the evicted Pods
    2. The Service type of the Deployment
    3. The number of Ingress rules in use
    4. What is filling the node's disk
    Show answer

    Answer: D. What is filling the node's disk

    Node pressure conditions trigger evictions. Clean up disk or add capacity.

  26. Question 26. The API server can't reach etcd after a certificate rotation. Where should you look?

    1. The CoreDNS Corefile in the kube-system namespace
    2. The etcd certificate flags in the API server manifest
    3. The kube-proxy ConfigMap in kube-system
    4. The PersistentVolumeClaims in the default namespace
    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.

  27. Question 27. Which exit code in a container status often means the process was killed with SIGKILL?

    1. 0
    2. 1
    3. 137
    4. 127
    Show answer

    Answer: C. 137

    137 is 128 + 9 (SIGKILL), often from OOM or a failed graceful shutdown. 127 means command not found.

  28. Question 28. A container exits with code 127. What does this typically mean?

    1. The container was killed for using too much memory
    2. The container completed successfully
    3. The command or entrypoint was not found
    4. The image registry was unreachable
    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.

  29. Question 29. A Pod can resolve external names but not cluster Service names. What should be checked?

    1. The node's swap setting and kernel version
    2. The StorageClass provisioner and its parameters
    3. The HPA target and its current metrics
    4. The Pod's dnsPolicy and resolv.conf search domains
    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.

  30. Question 30. Which command shows resource requests and allocations for a node?

    1. kubectl get node node1 -o name
    2. kubectl top node node1 --requests
    3. kubectl describe node node1
    4. kubectl logs node/node1
    Show answer

    Answer: C. kubectl describe node node1

    The Allocated resources section shows requested CPU and memory compared with capacity.

  31. Question 31. Which kubectl command lists Pods with their node and IP?

    1. kubectl get pods --show-labels
    2. kubectl get pods -o name
    3. kubectl get pods -o wide
    4. kubectl describe pods --short
    Show answer

    Answer: C. kubectl get pods -o wide

    The wide output adds IP, node, and more columns.

  32. Question 32. A Deployment was scaled to 5 replicas but only 3 run. Events show "exceeded quota". What limits it?

    1. A ResourceQuota in the namespace
    2. A NetworkPolicy
    3. A LimitRange default request
    4. The Service's selector
    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.

  33. Question 33. Why might a Pod fail with "0/3 nodes are available: 3 node(s) had untolerated taint"?

    1. The image doesn't exist
    2. All nodes have taints the Pod doesn't tolerate
    3. The Pod's PVC is bound
    4. The Service has too many ports
    Show answer

    Answer: B. All nodes have taints the Pod doesn't tolerate

    Add a toleration or remove the taint, depending on intent.

  34. Question 34. What does "Insufficient cpu" in a Pending Pod's events mean?

    1. The container is using too much CPU
    2. The CPU limit is lower than the request
    3. The node's CPU is broken
    4. No node has enough unrequested CPU for the Pod's requests
    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.

  35. Question 35. Where can you check whether CoreDNS is failing?

    1. kubectl logs -n default coredns
    2. journalctl -u coredns on every node
    3. kubectl logs -n kube-system -l k8s-app=kube-dns
    4. kubectl describe svc kubernetes
    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.

  36. Question 36. A new node joined but stays NotReady with "network plugin not ready". What is needed?

    1. A running CNI Pod and config in /etc/cni/net.d
    2. The node must be drained and uncordoned
    3. The node needs a PersistentVolume attached
    4. The node must run its own API server
    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.

  37. Question 37. An Ingress returns 503 errors. What is a likely cause?

    1. The IngressClass has too many annotations
    2. The node has too much free disk space
    3. The backend Service has no ready endpoints
    4. The CronJob schedule is wrong
    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.

  38. Question 38. A container keeps restarting because its liveness probe fails during slow startup. What should be changed?

    1. Add a startup probe or increase initialDelaySeconds
    2. Remove the readiness probe
    3. Change the Service type to NodePort
    4. Reduce the memory limit
    Show answer

    Answer: A. Add a startup probe or increase initialDelaySeconds

    The probe must allow enough time for the application to start.

  39. Question 39. How can you see why a container last terminated?

    1. kubectl get svc -o wide for the Pod's Service
    2. kubectl describe pod, then check Last State
    3. kubectl top pod --previous for the container
    4. kubectl get events --node for the Pod's node
    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.

  40. Question 40. A worker's kubelet logs show "x509: certificate has expired". What should be done?

    1. Delete all Pods running on the node
    2. Reinstall CoreDNS in kube-system
    3. Change the node's hostname and rejoin
    4. Renew the kubelet's client certificate
    Show answer

    Answer: D. Renew the kubelet's client certificate

    The kubelet needs a valid certificate to authenticate to the API server.

  41. Question 41. Which command checks the health of the etcd cluster with TLS?

    1. kubectl get etcd --all-namespaces --health
    2. kubeadm etcd status --cluster --verbose
    3. crictl etcd health --endpoints=local
    4. etcdctl endpoint health, with the TLS flags
    Show answer

    Answer: D. etcdctl endpoint health, with the TLS flags

    etcdctl endpoint health (and endpoint status) report whether members respond.

  42. Question 42. An application in a Pod can't connect to a database Service in another namespace. DNS works. What else could block it?

    1. A missing liveness probe on the application
    2. An HPA on the database
    3. The application's CPU request
    4. A NetworkPolicy in the database namespace
    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.

  43. Question 43. Which command confirms which image a Deployment is currently running?

    1. kubectl logs deployment/web --show-image
    2. kubectl get deploy web -o jsonpath='{..image}'
    3. kubectl top deployment web --containers
    4. kubectl describe service web --images
    Show answer

    Answer: B. kubectl get deploy web -o jsonpath='{..image}'

    JSONPath extracts the image field. kubectl describe deployment also shows it.

  44. Question 44. A node's disk is full of unused images. What reclaims space safely?

    1. Deleting the /var/lib/etcd directory
    2. Removing /etc/kubernetes/manifests
    3. Image garbage collection or crictl rmi --prune
    4. Restarting the API server Pod
    Show answer

    Answer: C. Image garbage collection or crictl rmi --prune

    Image GC removes unused images when disk usage crosses thresholds.

  45. Question 45. Which command shows the most recent failed Job's Pod logs?

    1. kubectl describe cronjob --logs
    2. kubectl top job JOB_NAME
    3. kubectl logs job/JOB_NAME
    4. kubectl get job JOB_NAME -o wide --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.

  46. Question 46. Why should you verify the context before changing resources during troubleshooting?

    1. Contexts expire every minute
    2. kubectl may be pointed at a different cluster or namespace
    3. The context sets the Pod's image
    4. Changes are applied to every cluster at once
    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.

  47. Question 47. A Pod's container is running but the app returns errors. Which command helps inspect environment variables inside it?

    1. kubectl describe node
    2. kubectl get configmap -A
    3. kubectl exec POD_NAME -- env
    4. kubectl top pod POD_NAME
    Show answer

    Answer: C. kubectl exec POD_NAME -- env

    env shows the variables the process actually received, which helps catch missing configuration.

  48. Question 48. Which log output helps diagnose why a node's kubelet can't pull an image from a private registry?

    1. The Pod's events, showing an auth error
    2. The Service's endpoints list
    3. The HPA's current target metrics
    4. The PVC's access modes and size
    Show answer

    Answer: A. The Pod's events, showing an auth error

    Missing or wrong imagePullSecrets show up as unauthorized errors in the events.

  49. Question 49. What does kubectl get componentstatuses (deprecated) show, and what's a better alternative?

    1. Pod logs; use kubectl logs for each component instead
    2. Control plane health; check kube-system Pods and /readyz instead
    3. Service endpoints; use kubectl get svc -A instead
    4. Node disk usage; use df -h on each node instead
    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.

  50. Question 50. Which API server endpoint reports whether it's ready to serve requests?

    1. /metrics/ready
    2. /healthz/nodes
    3. /readyz
    4. /status/api
    Show answer

    Answer: C. /readyz

    /livez and /readyz are the current health endpoints. /healthz is deprecated.

  51. Question 51. A Deployment rollout is stuck. Which command shows its progress?

    1. kubectl rollout status deployment/web
    2. kubectl get deployment web --progress
    3. kubectl describe replicaset --status
    4. kubectl logs deployment/web --rollout
    Show answer

    Answer: A. kubectl rollout status deployment/web

    rollout status waits and reports whether the rollout completed or stalled.

  52. Question 52. What is the purpose of a PodDisruptionBudget during troubleshooting and maintenance?

    1. It limits CPU usage during node maintenance
    2. It sets the order Pods are restarted after a crash
    3. It limits voluntary evictions, such as drains, to keep enough replicas running
    4. It prevents Pods from ever being deleted
    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.

  53. Question 53. A drain hangs on one Pod. What is a likely cause?

    1. A PodDisruptionBudget prevents the eviction
    2. The Pod uses a ClusterIP Service
    3. The node has an Ingress controller
    4. The Pod has a readiness probe
    Show answer

    Answer: A. A PodDisruptionBudget prevents the eviction

    Check the PDB's allowed disruptions. Scale up the workload or adjust the budget.

  54. Question 54. Which command shows the full YAML of a live Pod, including status fields?

    1. kubectl explain pod POD_NAME
    2. kubectl describe pod POD_NAME -o yaml
    3. kubectl get pod POD_NAME -o yaml
    4. kubectl logs POD_NAME -o yaml
    Show answer

    Answer: C. kubectl get pod POD_NAME -o yaml

    The live object includes status, conditions, and container states.

  55. Question 55. Which Pod condition shows that all containers have started and passed readiness?

    1. PodScheduled
    2. Ready
    3. Initialized
    4. ContainersCreating
    Show answer

    Answer: B. Ready

    Ready is required before a Pod is added to Service endpoints.

  56. Question 56. An init container keeps failing. What status does the Pod show?

    1. Running, with restarts
    2. Completed
    3. Init:CrashLoopBackOff
    4. Terminating
    Show answer

    Answer: C. Init:CrashLoopBackOff

    App containers don't start until all init containers succeed. Check the init container's logs with -c.

  57. Question 57. Which command shows only the Pods not in the Running phase in all namespaces?

    1. kubectl get pods -A --not-running --show-all-phases
    2. kubectl top pods -A --failed --sort-by=status.phase
    3. kubectl describe pods -A --phase=NotRunning --brief
    4. kubectl get pods -A --field-selector=status.phase!=Running
    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.

  58. Question 58. After fixing a static Pod manifest on a control plane node, what must be done?

    1. Run kubectl apply on the manifest file
    2. Reboot every node in the cluster
    3. Delete and recreate kube-system
    4. Nothing; the kubelet recreates the Pod
    Show answer

    Answer: D. Nothing; the kubelet recreates the Pod

    The kubelet watches the manifests directory and restarts static Pods automatically.

  59. Question 59. How can you confirm a Pod has the environment variable from a Secret without printing the Secret?

    1. Run kubectl get secret -o yaml in a shared channel
    2. Add the secret value to the Pod's logs
    3. Check the Pod spec for the secretKeyRef, then test the app behavior
    4. Store the Secret in a ConfigMap for easier viewing
    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.

  60. Question 60. A PVC is bound, but the Pod fails to start with a mount error. Where is the most useful information?

    1. The Service's endpoints and selector labels
    2. The HPA's status and target utilization
    3. The Pod's events and the node's CSI or kubelet logs
    4. The Ingress annotations and TLS settings
    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.

  61. Question 61. Why is it useful to set --dry-run=client -o yaml with kubectl create?

    1. It applies the resource without validation
    2. It generates a manifest you can edit before applying
    3. It deletes the resource after creating it
    4. It shows the resource's logs
    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.