WebMagicInformatica
CKA practice questions

CKA practice questions: Troubleshooting

6 free questions on Troubleshooting, 30% of the Kubernetes: CKA exam. Try each one, then open the answer and explanation. None of them are in the free readiness check, so you can still take it fresh.

Question 1

A Pod shows READY 0/1 and STATUS Running, and its Service has no endpoints. The events include Readiness probe failed: Get "http://10.244.1.7:8081/healthz": connect: connection refused. The container serves HTTP on port 8080. What is the issue?

  1. A.

    The readiness probe targets port 8081, but the application listens on 8080; correct the probe port.

  2. B.

    The Pod must be deleted; Running Pods are never added to Services.

  3. C.

    The liveness probe is restarting the container; remove the readiness probe from the Service.

  4. D.

    The node is out of IP addresses.

Show answer and explanation

Answer: A

Pods that fail readiness are removed from Service endpoints while staying Running. The probe points at the wrong port, so it gets connection refused.

  • Ready Pods are added to Services normally.
  • The event concerns the readiness probe, and removing it would mark unready Pods as ready.
  • IP exhaustion prevents Pod creation, not probing.
Question 2

kubectl get nodes shows worker1 as NotReady, and kubectl describe node worker1 reports Kubelet stopped posting node status. What should you check first?

  1. A.

    Run kubectl delete node worker1 so it re-registers with a clean status.

  2. B.

    Restart the kube-scheduler on the control plane.

  3. C.

    Run kubectl drain worker1 and uncordon it again.

  4. D.

    Log in to worker1 and run systemctl status kubelet and journalctl -u kubelet to see why the kubelet is not running.

Show answer and explanation

Answer: D

The status is reported by the kubelet. If it stopped posting, inspect the service and its logs on that node.

  • Deleting the node object does not fix a dead kubelet.
  • The scheduler does not report node status.
  • Draining just evicts Pods and does not repair the kubelet.
Question 3

Applications in the cluster fail DNS lookups. From a debug Pod, nslookup kubernetes.default times out. Which action is the best first step?

  1. A.

    Delete and recreate every application Deployment.

  2. B.

    Check the CoreDNS Pods and logs: kubectl -n kube-system get pods -l k8s-app=kube-dns and kubectl -n kube-system logs -l k8s-app=kube-dns.

  3. C.

    Edit /etc/hosts in each container image.

  4. D.

    Change every Service to NodePort.

Show answer and explanation

Answer: B

Cluster DNS is served by CoreDNS (labelled k8s-app=kube-dns). Confirm that its Pods are running, that the kube-dns Service has endpoints and read the logs.

  • Recreating applications does not repair the shared DNS service.
  • Hard-coding hosts files is a brittle workaround.
  • NodePort is unrelated to DNS resolution.
Question 4

A Service forwards to Pods, but curl http://10.96.12.5:80 returns connection refused, although endpoints exist. The Service and the Pod's container are configured as:

# Service
ports:
- port: 80
  targetPort: 8080
# Container
ports:
- containerPort: 3000

The application really listens on port 3000. How do you fix it?

  1. A.

    Change the Service port to 3000.

  2. B.

    Change the Service targetPort to 3000.

  3. C.

    Remove the selector from the Service.

  4. D.

    Set the Service type to NodePort.

Show answer and explanation

Answer: B

targetPort is the port on the Pod that traffic is sent to. It points at 8080 but the application listens on 3000, so connections are refused.

  • port is the Service's own port and clients can still use 80.
  • Removing the selector removes the endpoints.
  • A different type does not change the target.
Question 5Choose 2

Which TWO commands print recent log lines from the Pod web-1 and keep streaming new ones? (Choose two.)

  1. A.

    kubectl top pod web-1 --follow

  2. B.

    kubectl logs -f --tail=50 web-1

  3. C.

    kubectl logs web-1 --watch

  4. D.

    kubectl get pods web-1 -w

  5. E.

    kubectl logs web-1 --follow --since=10m

Show answer and explanation

Answer: B and E

-f/--follow streams logs; --tail and --since limit the history shown first.

  • logs has no --watch flag.
  • get -w watches the Pod object, not its output.
  • top has no --follow.
Question 6

Many Pods on worker3 show Evicted. kubectl describe node worker3 reports DiskPressure True. What is the right action?

  1. A.

    Increase the memory limit of every Pod.

  2. B.

    Add a toleration for node.kubernetes.io/disk-pressure to all workloads.

  3. C.

    Free up disk on the node (for example unused images and container logs) or add storage, then clean up the evicted Pod records.

  4. D.

    Delete the node object from the cluster.

Show answer and explanation

Answer: C

DiskPressure triggers kubelet eviction because node storage is nearly full. Fix the cause; evicted Pods remain as terminated records until removed.

  • Memory limits do not address disk pressure.
  • Tolerating the taint would keep scheduling onto a failing node.
  • Deleting the object does not free disk.

How ready are you for CKA?

Take the free readiness check: 15 questions from every exam domain in 20 minutes, with your score per domain.

  • 20 minutes
  • 15 questions
  • Free with an account

More CKA practice by topic

Back to the CKA practice test →

Independent practice material written from the official exam guide. Not affiliated with or endorsed by the exam provider.