Kubernetes
medium
Questão de Kubernetes #019e3a4f
Enunciado da Questão
Kubernetes
#kubernetes
#service
#pod
#networking
Médio
A Kubernetes _____ is an abstraction that defines a logical set of Pods and a policy by which to access them.
A
Selector
B
Controller
C
Service
Correta
D
Job
Explicação Oficial / Explicações da Comunidade
In Kubernetes, a Service is an abstraction that defines a logical set of Pods and a policy by which to access them. Services enable stable networking endpoints for Pods, which are ephemeral and can be created or destroyed dynamically. A Service selects Pods based on labels and provides load-balanced access to them, typically via a cluster-internal IP or an external load balancer.
How it Works
- A Service uses a label selector to identify the Pods it targets. When Pods match the selector, they become endpoints of the Service.
- The Service assigns a stable IP address (ClusterIP) and DNS name, so clients can reach the Pods without knowing their individual IPs.
- Traffic to the Service is load-balanced across the selected Pods.
Why the Correct Answer is Right
- Service is the correct Kubernetes resource that provides a stable endpoint for a set of Pods. It abstracts the Pod IPs and handles discovery and load balancing.
Why the Incorrect Answers are Wrong
- Selector is not a Kubernetes resource; it is a field used in Services and other controllers to match Pods by labels.
- Controller is a broad term for control loops (e.g., ReplicaSet, Deployment) that manage Pod lifecycle, but it does not define access policies.
- Job is a resource for running batch tasks to completion, not for providing network access to Pods.