Bird
0
0

Given a pod in namespace frontend running:

medium📝 Command Output Q4 of 15
Kubernetes - Namespaces
Given a pod in namespace frontend running:
curl api.backend.svc.cluster.local

What will happen if the api service in backend namespace does not exist?
AThe curl command will fail with a DNS resolution error
BThe curl command will succeed but return empty response
CThe curl command will connect to a default service
DThe pod will restart automatically
Step-by-Step Solution
Solution:
  1. Step 1: Understand DNS resolution in Kubernetes

    If the service does not exist, DNS lookup for api.backend.svc.cluster.local fails.
  2. Step 2: Effect on curl command

    Without DNS resolution, curl cannot connect and returns an error.
  3. Final Answer:

    The curl command will fail with a DNS resolution error -> Option A
  4. Quick Check:

    Missing service causes DNS failure [OK]
Quick Trick: Missing service causes DNS failure, curl errors out [OK]
Common Mistakes:
  • Assuming curl returns empty response
  • Thinking pod restarts on DNS failure
  • Believing it connects to a default service

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes