Which of the following best describes a headless service in Kubernetes?

Study for the Kubernetes Certified Network Administrator Exam. Our test offers comprehensive flashcards, multiple-choice questions, and detailed explanations. Be confident for your exam!

Multiple Choice

Which of the following best describes a headless service in Kubernetes?

Explanation:
A headless service is defined by not getting a cluster IP. When you create such a service (clusterIP is None), there isn’t a single virtual IP to front the pods. Instead, the service’s DNS name resolves to the actual pods backing it, so clients can reach the individual pod IPs directly through DNS, or use SRV records to discover the ports. This is why the description “no cluster IP, allowing direct pod DNS resolution” best captures headless services. That’s why the other statements don’t fit: there isn’t a service-level load balancer for traffic distribution, since there’s no cluster IP to balance to; internal DNS is sufficient for DNS resolution—external DNS isn’t a requirement; and while headless services are often used within the cluster, they aren’t defined by being strictly inaccessible from outside the cluster.

A headless service is defined by not getting a cluster IP. When you create such a service (clusterIP is None), there isn’t a single virtual IP to front the pods. Instead, the service’s DNS name resolves to the actual pods backing it, so clients can reach the individual pod IPs directly through DNS, or use SRV records to discover the ports. This is why the description “no cluster IP, allowing direct pod DNS resolution” best captures headless services.

That’s why the other statements don’t fit: there isn’t a service-level load balancer for traffic distribution, since there’s no cluster IP to balance to; internal DNS is sufficient for DNS resolution—external DNS isn’t a requirement; and while headless services are often used within the cluster, they aren’t defined by being strictly inaccessible from outside the cluster.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy