Networking
medium

Questão de Networking #019e3a4f

Enunciado da Questão
Networking
#kubernetes
#service
#endpoint
Médio

What is a Kubernetes Service Endpoint?

A

It is the API Endpoint of our Kubernetes cluster.

B

It is a name of special Pod in kube-system namespace.

C

It is an IP address that we can access from the Internet.

D

It is an object that gets IP addresses of individual Pods assigned to it.

Correta

Explicação Oficial / Explicações da Comunidade

A Kubernetes Service Endpoint is an object that gets IP addresses of individual Pods assigned to it. In Kubernetes, a Service provides a stable IP address and DNS name for a set of Pods. The Service Endpoints object (often referred to as Endpoints) is automatically updated by the control plane to contain the IP addresses of Pods that match the Service's selector. When a Pod is created or deleted, the Endpoints are updated accordingly. This allows traffic sent to the Service IP to be load-balanced across the Pods listed in the Endpoints.

How it Works:

  • A Service is defined with a selector that matches Pod labels.
  • The Kubernetes control plane continuously monitors Pods and updates the Endpoints object with the IP addresses of Pods that match the selector.
  • The kube-proxy component on each node watches the Endpoints and configures iptables or IPVS rules to forward traffic from the Service IP to the Pod IPs.
  • This ensures that even if Pods are rescheduled or scaled, the Service remains accessible via its stable IP.

Why the correct answer is right:
The statement "It is an object that gets IP addresses of individual Pods assigned to it" accurately describes the Endpoints object. It is a separate API resource that holds the list of Pod IPs for a given Service.

Why the incorrect answers are wrong:

  • "It is the API Endpoint of our Kubernetes cluster" is incorrect because the API endpoint refers to the URL used to access the Kubernetes API server, not a Service Endpoint.
  • "It is a name of special Pod in kube-system namespace" is incorrect because there is no special Pod named "Service Endpoint"; the Endpoints are API objects, not Pods.
  • "It is an IP address that we can access from the Internet" is incorrect because a Service Endpoint is not a single IP address; it is a collection of Pod IPs, and it may or may not be accessible from the Internet depending on the Service type (e.g., NodePort, LoadBalancer).