liveBook · Manning

Endpoint slice

As explained in Kubernetes in Action, Second Edition

An EndpointSlice is a Kubernetes API resource that represents a scalable set of network endpoints for a Service and their associated metadata.

An EndpointSlice is a Kubernetes API resource that represents a scalable set of network endpoints for a Service. It divides one Service’s endpoints across multiple objects, avoiding the performance cost of sending one large Endpoints object to every cluster node whenever a change occurs. Kubernetes creates and manages these slices automatically. section 11.3.2

EndpointSlices make Service endpoints easier to scale and inspect:

  • Each slice contains one endpoint subset; different Service ports can therefore appear in different slices. section 11.3.2
  • A slice supports up to 1,000 endpoints, while Kubernetes adds up to 100 endpoints per slice by default; ports are limited to 100. section 11.3.2
  • Slice names include a generated suffix, so one Service can have several independently named EndpointSlices. section 11.3.2
  • Endpoint data records addresses, readiness, the target Pod, node, and available ports, making it useful for examining why traffic does or does not reach a Pod. section 11.3.2 section 11.6.2

List and inspect a Service's slices

Run `kubectl get endpointslices` to list slices. Filter them with `kubectl get endpointslices -l kubernetes.io/service-name=kiada`, then inspect one with `kubectl describe endpointslice kiada`. The output shows IPv4 addressing, ports such as 8080 and 8443, endpoint addresses, a `ready` condition, and the referenced Pod.

Readiness and topology-aware routing

A Pod with an unsuccessful readiness probe remains represented in its EndpointSlice with `conditions.ready: false`, so the Service should not send it traffic. When topology-aware hints are enabled with the Service annotation `service.kubernetes.io/topology-aware-hints: Auto`, the EndpointSlice can identify zones that should consume each endpoint, helping keep traffic within an availability zone when suitable endpoints exist. section 11.6.2 section 11.5.2

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains slicing limits, generated names, inspection fields, readiness, and topology hints without detailing controller implementation internals.
Examples
Uses kubectl listings, label selectors, describe output, readiness states, and zone-specific endpoint hints.
What it assumes
Assumes familiarity with Services and Pods while demonstrating readiness probes and endpoint inspection through concrete commands.
What you can do after
Diagnose Service endpoint membership and readiness with kubectl, then interpret topology hints and endpoint metadata.
How it connects
Connects EndpointSlice with Services, Pods, readiness probes, Endpoints, cluster networking, and topology-aware routing.

Also explained in

Compare how 2 books explain endpoint slice →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.