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:describe for a concise summary:
2. Scaling and Endpoint Updates
Kubernetes updates the Endpoints list automatically when Pods are added or removed.-
Scale to two replicas:
-
Wait for both Pods to be
Running: -
Describe Endpoints again:
-
Delete one Pod and observe the update:
-
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
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: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.