Bird
0
0

A headless service is created but pods are not reachable via DNS. What YAML mistake could cause this?

medium📝 Troubleshoot Q7 of 15
Kubernetes - Services
A headless service is created but pods are not reachable via DNS. What YAML mistake could cause this?
AUsing <code>type: ClusterIP</code> explicitly
BMissing <code>clusterIP: None</code> in service spec
COmitting the ports section
DSetting <code>externalTrafficPolicy: Local</code>
Step-by-Step Solution
Solution:
  1. Step 1: Verify headless service YAML

    Headless service requires clusterIP: None to disable cluster IP.
  2. Step 2: Effect of missing clusterIP None

    Without it, service gets a cluster IP and DNS returns that IP, not pod IPs.
  3. Final Answer:

    Missing clusterIP None disables headless DNS behavior -> Option B
  4. Quick Check:

    clusterIP None missing = no headless DNS [OK]
Quick Trick: Always set clusterIP: None for headless service [OK]
Common Mistakes:
  • Assuming type ClusterIP disables headless
  • Ignoring ports section impact on DNS
  • Confusing externalTrafficPolicy with DNS behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes