Networking
medium
Questão de Networking #019e3a4f
Enunciado da Questão
Networking
#kubernetes
#service
#headless
#cluster-ip
#dns
Médio
What is a Kubernetes service with no cluster IP address called?
A
Headless Service
Correta
B
Nodeless Service
C
IPLess Service
D
Specless Service
Explicação Oficial / Explicações da Comunidade
A Kubernetes service with no cluster IP is called a Headless Service. This is achieved by setting the clusterIP field to None in the service specification. Headless services are used when you want to discover individual pod IPs directly via DNS, rather than load-balancing traffic through a virtual IP. They are commonly used with stateful applications like databases (e.g., Cassandra, ZooKeeper) where each pod needs a stable network identity.
How it Works
- In a normal service, Kubernetes assigns a virtual cluster IP that load-balances traffic to the pods. DNS queries for the service name return that single IP.
- In a headless service, no cluster IP is assigned. Instead, DNS queries return the IP addresses of all pods matching the service's selector. This allows clients to connect directly to individual pods.
- To create a headless service, set
spec.clusterIP: Nonein the service YAML.
Why the Correct Answer is Right
- Headless Service is the standard Kubernetes term for a service without a cluster IP. It is documented in the official Kubernetes documentation and is widely used in production.
Why the Incorrect Answers are Wrong
- Nodeless Service: This term does not exist in Kubernetes. Nodes are worker machines; a service without nodes is not a concept.
- IPLess Service: While descriptive, this is not the official Kubernetes term. The correct term is "headless service."
- Specless Service: This term is not used in Kubernetes. A service always has a specification; "specless" is meaningless.