Bird
0
0

You need a headless service that supports direct pod connections and stable DNS names for pods managed by a StatefulSet. Which configuration is correct?

hard📝 Workflow Q8 of 15
Kubernetes - Services
You need a headless service that supports direct pod connections and stable DNS names for pods managed by a StatefulSet. Which configuration is correct?
ACreate a Service without selectors and manually manage endpoints
BCreate a Service with a cluster IP and set <code>publishNotReadyAddresses: true</code>
CUse a LoadBalancer Service with externalIPs matching pod IPs
DCreate a headless Service with <code>clusterIP: None</code> and use the StatefulSet's <code>serviceName</code> field
Step-by-Step Solution
Solution:
  1. Step 1: Understand StatefulSet DNS

    StatefulSets rely on a headless Service to provide stable network IDs for pods.
  2. Step 2: Headless Service setup

    Setting clusterIP: None creates a headless Service that returns pod IPs directly.
  3. Step 3: Linking StatefulSet and Service

    The StatefulSet's serviceName must reference the headless Service to enable stable DNS names.
  4. Final Answer:

    Create a headless Service with clusterIP None and use StatefulSet's serviceName field -> Option D
  5. Quick Check:

    Verify clusterIP None and StatefulSet serviceName match [OK]
Quick Trick: StatefulSet needs headless Service with matching serviceName [OK]
Common Mistakes:
  • Using cluster IP Service for StatefulSet DNS
  • Not setting serviceName in StatefulSet spec
  • Manually managing endpoints instead of selectors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes