In StatefulSets, which service type is used to enable DNS-based addressing without a cluster IP?

Study for the Kubernetes Cloud Native Associate (KCNA) Certification 1 Test. Master the core concepts of Kubernetes with multiple-choice questions and detailed explanations. Prepare and boost your confidence for the KCNA certification exam!

Multiple Choice

In StatefulSets, which service type is used to enable DNS-based addressing without a cluster IP?

Explanation:
In StatefulSets, you want each pod to have a stable network identity and be addressable directly by DNS without routing through a single cluster IP. This is achieved with a headless service, which has no cluster IP (clusterIP: None). With a headless service, DNS resolves to the individual pods, giving each ordinal pod a stable hostname like <statefulset-name>-<ordinal>.<service-name>.<namespace>.svc.cluster.local. This enables DNS-based addressing exactly for the per-pod identities that StatefulSets rely on. Other service types always allocate a cluster IP and present a single virtual IP, which doesn’t provide per-pod DNS records required for direct pod addressing. ExternalName maps to external addresses and isn’t used for internal DNS resolution of pods.

In StatefulSets, you want each pod to have a stable network identity and be addressable directly by DNS without routing through a single cluster IP. This is achieved with a headless service, which has no cluster IP (clusterIP: None). With a headless service, DNS resolves to the individual pods, giving each ordinal pod a stable hostname like -...svc.cluster.local. This enables DNS-based addressing exactly for the per-pod identities that StatefulSets rely on.

Other service types always allocate a cluster IP and present a single virtual IP, which doesn’t provide per-pod DNS records required for direct pod addressing. ExternalName maps to external addresses and isn’t used for internal DNS resolution of pods.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy