Bird
0
0

You execute kubectl exec -it app-pod -- wget --timeout=5 http://backend-service and the command hangs until timeout. What is the most probable reason?

medium📝 Command Output Q4 of 15
Kubernetes - Troubleshooting
You execute kubectl exec -it app-pod -- wget --timeout=5 http://backend-service and the command hangs until timeout. What is the most probable reason?
AThe service has no endpoints because no pods match its selector
BThe pod does not have network access to the cluster DNS
CThe service type is NodePort but the node port is blocked by firewall
DThe pod's container image lacks wget utility
Step-by-Step Solution
Solution:
  1. Step 1: Check service endpoints

    Verify if the service has any endpoints assigned using kubectl get endpoints backend-service.
  2. Step 2: Understand timeout cause

    If no endpoints exist, the service cannot route traffic to any pod, causing the connection to hang and eventually timeout.
  3. Final Answer:

    The service has no endpoints because no pods match its selector -> Option A
  4. Quick Check:

    Check endpoints first when service requests timeout [OK]
Quick Trick: Check service endpoints before debugging timeouts [OK]
Common Mistakes:
  • Assuming DNS is the issue without checking endpoints
  • Ignoring service selector mismatch
  • Blaming firewall without verifying service type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes