Bird
0
0

After creating a headless service, DNS queries for the service name return no pod IPs. What is a common misconfiguration causing this?

medium📝 Troubleshoot Q6 of 15
Kubernetes - Services
After creating a headless service, DNS queries for the service name return no pod IPs. What is a common misconfiguration causing this?
AThe Service selector does not match any pod labels
BThe Service type is set to LoadBalancer instead of ClusterIP
CThe pods are running in a different namespace than the Service
DThe Service ports are not defined
Step-by-Step Solution
Solution:
  1. Step 1: Check Service selector

    The Service selector must match pod labels to associate pods with the Service.
  2. Step 2: Impact of selector mismatch

    If no pods match the selector, DNS has no pod IPs to return for the headless Service.
  3. Step 3: Other options

    Service type or namespace mismatch would cause different issues; ports missing does not affect DNS resolution.
  4. Final Answer:

    The Service selector does not match any pod labels -> Option A
  5. Quick Check:

    Verify selector labels match pod labels [OK]
Quick Trick: Selector must match pods for DNS to return IPs [OK]
Common Mistakes:
  • Ignoring selector label mismatch
  • Assuming Service type affects DNS for headless
  • Not verifying namespace consistency

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes