CKAD Application Observability and Maintenance Practice Question
A pod is running but the application inside is not serving traffic. The team runs 'kubectl exec -it <pod> -- curl localhost:8080' and gets 'Connection refused'. What is the most likely cause?
⚠ Common exam trap
CNCF often tests the distinction between 'Connection refused' (no listener) and 'Connection timed out' (network block) — candidates mistakenly attribute the error to NetworkPolicy or resource issues, but the immediate RST is a definitive sign of a missing socket, not a network filter.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Application is not listening on port 8080
The 'Connection refused' error from curl indicates that the TCP connection to port 8080 was actively rejected by the kernel, meaning no process is listening on that port inside the container. This is most commonly caused by the application not starting, crashing before binding, or being configured to listen on a different port (e.g., 3000, 8443). The error is immediate and does not suggest a timeout or network-level block.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Container logs are full and writing to disk is slow
Why it's wrong here
Full container logs or slow disk writes affect filesystem operations in the pod's container filesystem, not the TCP networking stack. Even if the node is under disk pressure, an already-running application process keeps its listening socket bound, so a client connecting to localhost:8080 would still succeed. The connection refused error (ECONNREFUSED) is generated by the kernel only when no process has bound to that address and port, so disk slowness cannot produce this symptom.
- ✗
NetworkPolicy is blocking traffic
Why it's wrong here
NetworkPolicy resources in Kubernetes are enforced by the CNI plugin on pod network interfaces for traffic coming from other pods or external endpoints, following ingress/egress rules. A connection to 127.0.0.1 (loopback) stays entirely inside the pod's network namespace and does not traverse the pod's eth0 or any network policy rule set. Even an 'allow-all' or 'deny-all' NetworkPolicy does not affect loopback traffic; a refused connection from localhost means no listener rather than a policy denial.
- ✓
Application is not listening on port 8080
Why this is correct
Connection refused means the client sent a SYN to port 8080 on the loopback address, and the kernel responded with RST because nothing is bound to that listen socket. The application either never started, crashed before binding, or is configured to listen on a different port or interface such as 127.0.0.1:9090 instead of 0.0.0.0:8080. Troubleshooting should include checking the process in the container (ss -tlnp), reading application logs, and confirming the command/config passed to the container.
- ✗
Liveness probe is failing and restarting the container
Why it's wrong here
A failing liveness probe causes Kubernetes to restart the container, but the probe failure is a symptom of the application becoming unhealthy—it does not itself make the port unreachable. If the container were stuck in a restart loop, you would see a non-zero RESTARTS count in the pod status and likely CrashLoopBackOff, whereas the question only reports 'connection refused' when connecting from the pod. The restart action may briefly make the app unavailable, but the root issue is still the application not listening; the probe and the connection refused share the same underlying cause.
Visual reference
Go deeper
Related to this question
About these practice questions
This CKAD question is part of Courseiva's 826-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.