Bird
0
0

Given this service YAML snippet, what will be the DNS behavior?

medium📝 Command Output Q13 of 15
Kubernetes - Services
Given this service YAML snippet, what will be the DNS behavior?
apiVersion: v1
kind: Service
metadata:
  name: my-headless-service
spec:
  clusterIP: None
  selector:
    app: myapp
  ports:
  - port: 80
    targetPort: 8080
ADNS returns multiple pod IPs matching the selector
BDNS returns a single IP of a load balancer
CDNS returns no IP because clusterIP is None
DDNS returns the external IP of the cluster
Step-by-Step Solution
Solution:
  1. Step 1: Analyze clusterIP: None effect on DNS

    With clusterIP set to None, DNS returns the IPs of all pods matching the selector, not a single IP.
  2. Step 2: Understand DNS response for headless services

    DNS returns multiple A records, one per pod IP, enabling direct pod access.
  3. Final Answer:

    DNS returns multiple pod IPs matching the selector -> Option A
  4. Quick Check:

    Headless DNS = multiple pod IPs [OK]
Quick Trick: Headless service DNS returns pod IPs, not one IP [OK]
Common Mistakes:
  • Thinking DNS returns a load balancer IP
  • Assuming no IP is returned when clusterIP is None
  • Confusing external IP with pod IPs

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes