Bird
0
0

You have a pod in namespace frontend trying to reach a service in backend using curl backend-service. The command fails. What is the most likely cause?

medium📝 Debug Q6 of 15
Kubernetes - Namespaces
You have a pod in namespace frontend trying to reach a service in backend using curl backend-service. The command fails. What is the most likely cause?
AThe pod is not running
BThe service name is incorrect
CThe pod did not specify the namespace in the service DNS name
DThe backend namespace does not exist
Step-by-Step Solution
Solution:
  1. Step 1: Check DNS resolution across namespaces

    Using only service name without namespace resolves only within the same namespace.
  2. Step 2: Effect of missing namespace in DNS

    Pod in frontend namespace cannot resolve backend-service without specifying backend namespace.
  3. Final Answer:

    The pod did not specify the namespace in the service DNS name -> Option C
  4. Quick Check:

    Missing namespace in DNS causes resolution failure [OK]
Quick Trick: Always include namespace in service DNS for cross-namespace calls [OK]
Common Mistakes:
  • Assuming service name alone works cross-namespace
  • Blaming pod status without checking DNS
  • Assuming namespace does not exist without verification

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes