Skip to main content
In this tutorial, we’ll explore how Kubernetes manages Endpoints and Endpoint Slices by deploying a simple Nginx application. You’ll learn how to inspect the Endpoints resource, watch automatic updates as you scale Pods, and examine the more scalable Endpoint Slices feature introduced in Kubernetes 1.17.

1. Deploy Nginx and Inspect Endpoints

1.1 Verify Deployment and Service

First, create an Nginx Deployment and a ClusterIP Service (assumed already applied). Then confirm they’re up and running:

1.2 List Endpoints

Kubernetes automatically creates an Endpoints object that tracks the Pod IPs behind a Service:
The nginx-service Endpoints resource shows the Pod’s IP (10.0.0.55) and port (80).

1.3 Inspect the Endpoints Resource

View the full Endpoints object:
Alternatively, use describe for a concise summary:

2. Scaling and Endpoint Updates

Kubernetes updates the Endpoints list automatically when Pods are added or removed.
  1. Scale to two replicas:
  2. Wait for both Pods to be Running:
  3. Describe Endpoints again:
  4. Delete one Pod and observe the update:
  5. Scale back to one replica:

3. Exploring Endpoint Slices

Endpoint Slices improve scalability by splitting Service backends into multiple slice objects.

3.1 List Endpoint Slices

3.2 Inspect a Single EndpointSlice

Or use:
Endpoint Slices are created by default in Kubernetes v1.21+. Make sure your cluster version supports discovery.k8s.io/v1.

3.3 EndpointSlice Updates on Scaling

Scale to two replicas:
Scale back to one replica and verify:

4. Comparison and Conclusion

Kubernetes manages both Endpoints and Endpoint Slices automatically. Use Endpoints for small clusters and Endpoint Slices to handle large-scale Service connectivity efficiently.

Watch Video