Tasks

Kubernetes v1.16 documentation is no longer actively maintained. The version you are currently viewing is a static snapshot. For up-to-date documentation, see the latest version.

Edit This Page

Enabling Endpoint Slices

This page provides an overview of enabling Endpoint Slices 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:

To check the version, enter kubectl version.

Introduction

Endpoint Slices 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 Endpoint Slice resources instead of a single large Endpoints resource.

Enabling Endpoint Slices

FEATURE STATE: Kubernetes v1.16 alpha
This feature is currently in a alpha state, meaning:

  • The version names contain alpha (e.g. v1alpha1).
  • Might be buggy. Enabling the feature may expose bugs. Disabled by default.
  • Support for feature may be dropped at any time without notice.
  • The API may change in incompatible ways in a later software release without notice.
  • Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support.
Note: Although Endpoint Slices may eventually replace Endpoints, many Kubernetes components still rely on Endpoints. For now, enabling Endpoint Slices should be seen as an addition to Endpoints in a cluster, not a replacement for them.

As an alpha feature, Endpoint Slices are not enabled by default in Kubernetes. Enabling Endpoint Slices requires as many as 3 changes to Kubernetes cluster configuration.

To enable the Discovery API group that includes Endpoint Slices, use the runtime config flag (--runtime-config=discovery.k8s.io/v1alpha1=true).

The logic responsible for watching services, pods, and nodes and creating or updating associated Endpoint Slices lives within the EndpointSlice controller. This is disabled by default but can be enabled with the controllers flag on kube-controller-manager (--controllers=endpointslice).

For Kubernetes components like kube-proxy to actually start using Endpoint Slices, the EndpointSlice feature gate will need to be enabled (--feature-gates=EndpointSlice=true).

Using Endpoint Slices

With Endpoint Slices fully enabled in your cluster, you should see corresponding EndpointSlice resources for each Endpoints resource. In addition to supporting existing Endpoints functionality, Endpoint Slices should include new bits of information such as topology. They will allow for greater scalability and extensibility of network endpoints in your cluster.

Feedback