This page provides an overview of enabling EndpointSlices in Kubernetes.
Before you begin
You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:
EndpointSlices provide a scalable and extensible alternative to Endpoints in Kubernetes. They build on top of the base of functionality provided by Endpoints and extend that in a scalable way. When Services have a large number (>100) of network endpoints, they will be split into multiple smaller EndpointSlice resources instead of a single large Endpoints resource.
Kubernetes v1.17 [beta]
Note: The EndpointSlice resource was designed to address shortcomings in a earlier resource: Endpoints. Some Kubernetes components and third-party applications continue to use and rely on Endpoints. Whilst that remains the case, EndpointSlices should be seen as an addition to Endpoints in a cluster, not as an outright replacement.
EndpointSlice functionality in Kubernetes is made up of several different components, most are enabled by default:
- The EndpointSlice API: EndpointSlices are part of the
discovery.k8s.io/v1beta1API. This is beta and enabled by default since Kubernetes 1.17. All components listed below are dependent on this API being enabled.
- The EndpointSlice Controller: This controller maintains EndpointSlices for Services and the Pods
they reference. This is controlled by the
EndpointSlicefeature gate. It has been enabled by default since Kubernetes 1.18.
- The EndpointSliceMirroring Controller: This controller mirrors custom Endpoints to
EndpointSlices. This is controlled by the
EndpointSlicefeature gate. It has been enabled by default since Kubernetes 1.19.
- Kube-Proxy: When kube-proxy
is configured to use EndpointSlices, it can support higher numbers of Service
endpoints. This is controlled by the
EndpointSliceProxyingfeature gate on Linux and
WindowsEndpointSliceProxyingon Windows. It has been enabled by default on Linux since Kubernetes 1.19. It is not enabled by default for Windows nodes. To configure kube-proxy to use EndpointSlices on Windows, you can enable the
WindowsEndpointSliceProxyingfeature gate on kube-proxy.
Some fields in the EndpointSlice API are feature-gated.
EndpointSliceNodeNamefeature gate controls access to the
nodeNamefield. This is an alpha feature that is disabled by default.
EndpointSliceTerminatingfeature gate controls access to the
terminatingcondition fields. This is an alpha feature that is disabled by default.
With EndpointSlices fully enabled in your cluster, you should see corresponding EndpointSlice resources for each Endpoints resource. In addition to supporting existing Endpoints functionality, EndpointSlices will allow for greater scalability and extensibility of network endpoints in your cluster.