Course contentsShow
← Cloud and Infrastructure
Lesson 1211 of 2,98924. Kubernetes NetworkingFree lesson

Endpoints Objects

Understanding how Kubernetes tracks and updates the IP addresses of Pods backing each Service.

Endpoints Objects

You'll learn: How Kubernetes automatically tracks the individual Pod IPs behind every Service to keep traffic routing current.

What Are Endpoints?

When you create a Service in Kubernetes, it needs to know where to send traffic—specifically, which Pod IPs match the Service's selector. Endpoints are the automatically-generated objects that maintain this mapping.

Think of a Service as a restaurant's phone number that never changes, and Endpoints as the ever-updating list of servers currently on shift. When a Pod matching the Service's label selector starts or stops, Kubernetes updates the Endpoints object to reflect the current roster of available backend IPs and ports.

How Endpoints Work

Every time you create a Service (like ClusterIP, NodePort, or LoadBalancer), Kubernetes creates a corresponding Endpoints object with the same name. The Endpoints controller continuously watches:

  • Pods matching the Service selector
  • Their readiness status
  • Their current IP addresses

When a Pod becomes ready, its IP is added to the Endpoints list. When it's deleted or fails readiness checks, the IP is removed. This happens automatically—you rarely create Endpoints manually.

# View endpoints for a service
kubectl get endpoints my-service

The output shows the Pod IPs and ports that currently back the Service. If you see <none>, no Pods match your Service selector (a common debugging clue!).

Why This Matters

Without Endpoints, Services wouldn't know where to route traffic as Pods scale up, down, or restart with new IPs. This dynamic registry is what makes Kubernetes networking resilient and self-healing.

Key Takeaway: Endpoints objects are Kubernetes' internal registry that maps Service names to the live, ready Pod IPs backing them—updated automatically as your workloads change.