[zh] Sync tasks/administer-cluster/enabling-endpointslices.md

This commit is contained in:
Qiming Teng
2020-11-20 13:56:36 +08:00
parent 1e38b53fc8
commit 0fb07f776b
@@ -1,110 +1,130 @@
---
reviewers:
- bowei
- freehan
title: 启用端点切片
title: 启用 EndpointSlices
content_type: task
---
<!--
---
reviewers:
- bowei
- freehan
title: Enabling Endpoint Slices
title: Enabling EndpointSlices
content_type: task
---
-->
<!-- overview -->
<!--
This page provides an overview of enabling Endpoint Slices in Kubernetes.
This page provides an overview of enabling EndpointSlices in Kubernetes.
-->
本页提供启用 Kubernetes 端点切片的总览
本页提供启用 Kubernetes EndpointSlice 的总览
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
<!-- steps -->
<!--
## Introduction
Endpoint Slices provide a scalable and extensible alternative to Endpoints in
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 Endpoint Slice
network endpoints, they will be split into multiple smaller EndpointSlice
resources instead of a single large Endpoints resource.
-->
## 介绍
端点切片为 Kubernetes 端点提供了可伸缩和可扩展的替代方案。它们建立在端点提供的功能基础之上,并以可伸缩的方式进行扩展。当服务具有大量(>100)网络端点,
它们将被分成多个较小的端点切片资源,而不是单个大型端点资源
EndpointSlice 端点切片为 Kubernetes Endpoints 提供了可伸缩和可扩展的替代方案。
它们建立在 Endpoints 提供的功能基础之上,并以可伸缩的方式进行扩展
当 Service 具有大量(>100)网络端点时,它们将被分成多个较小的 EndpointSlice 资源,
而不是单个大型 Endpoints 资源。
<!--
## Enabling Endpoint Slices
## Enabling EndpointSlices
-->
## 启用端点切片
{{< feature-state for_k8s_version="v1.16" state="alpha" >}}
## 启用 EndpointSlice
{{< feature-state for_k8s_version="v1.17" state="beta" >}}
{{< note >}}
<!--
Although Endpoint Slices may eventually replace Endpoints, many Kubernetes
components still rely on Endpoints. For now, enabling Endpoint Slices should be
Although EndpointSlices may eventually replace Endpoints, many Kubernetes
components still rely on Endpoints. For now, enabling EndpointSlices should be
seen as an addition to Endpoints in a cluster, not a replacement for them.
-->
尽管端点切片最终可能会取代端点,但许多 Kubernetes 组件仍然依赖于端点。目前,启用端点切片应该被视为集群中端点的补充,而不是它们的替代。
尽管 EndpointSlice 最终可能会取代 Endpoints,但许多 Kubernetes 组件仍然依赖于
Endpoints。目前,启用 EndpointSlice 应该被视为集群中 Endpoints 的补充,而不是
替代它们。
{{< /note >}}
<!--
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`).
EndpointSlice functionality in Kubernetes is made up of several different
components, most are enabled by default:
-->
Kubernetes 中的 EndpointSlice 功能包含若干不同组件。它们中的大部分都是
默认被启用的:
作为 Alpha 功能,默认情况下,Kubernetes 中未启用端点切片。启用端点切片需要对 Kubernetes 集群进行多达 3 项配置修改。
<!--
* _The EndpointSlice API_: EndpointSlices are part of the
`discovery.k8s.io/v1beta1` API. 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 {{< glossary_tooltip text="controller"
term_id="controller" >}} maintains EndpointSlices for Services and the Pods
they reference. This is controlled by the `EndpointSlice` feature gate. It has
been enabled by default since Kubernetes 1.18.
-->
* _EndpointSlice API_EndpointSlice 隶属于 `discovery.k8s.io/v1beta1` API。
此 API 处于 Beta 阶段,从 Kubernetes 1.17 开始默认被启用。
下面列举的所有组件都依赖于此 API 被启用。
* _EndpointSlice 控制器_:此 {{< glossary_tooltip text="控制器" term_id="controller" >}}
为 Service 维护 EndpointSlice 及其引用的 Pods。
此控制器通过 `EndpointSlice` 特性门控控制。自从 Kubernetes 1.18 起,
该特性门控默认被启用。
要启用包括端点切片的 Discovery API 组,请使用运行时配置标志(`--runtime-config=discovery.k8s.io/v1alpha1=true`)。
该逻辑负责监视服务,pod 和节点以及创建或更新与之关联,在端点切片控制器内的端点切片。
默认情况下,此功能处于禁用状态,但可以通过启用在 kube-controller-manager 控制器的标志(`--controllers=endpointslice`)来开启。
对于像 kube-proxy 这样的 Kubernetes 组件真正开始使用端点切片,需要开启端点切片功能标志(`--feature-gates=EndpointSlice=true`)。
<!--
* _The EndpointSliceMirroring Controller_: This {{< glossary_tooltip
text="controller" term_id="controller" >}} mirrors custom Endpoints to
EndpointSlices. This is controlled by the `EndpointSlice` feature gate. It has
been enabled by default since Kubernetes 1.19.
* _Kube-Proxy_: When {{< glossary_tooltip text="kube-proxy" term_id="kube-proxy">}}
is configured to use EndpointSlices, it can support higher numbers of Service
endpoints. This is controlled by the `EndpointSliceProxying` feature gate on
Linux and `WindowsEndpointSliceProxying` on 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 `WindowsEndpointSliceProxying` [feature
gate](/docs/reference/command-line-tools-reference/feature-gates/) on
kube-proxy.
-->
* _EndpointSliceMirroring 控制器_:此 {{< glossary_tooltip text="控制器" term_id="controller" >}}
将自定义的 Endpoints 映射为 EndpointSlice。
控制器受 `EndpointSlice` 特性门控控制。该特性门控自 1.19 开始被默认启用。
* _kube-proxy_:当 {{< glossary_tooltip text="kube-proxy" term_id="kube-proxy">}}
被配置为使用 EndpointSlice 时,它会支持更大数量的 Service 端点。
此功能在 Linux 上受 `EndpointSliceProxying` 特性门控控制;在 Windows 上受
`WindowsEndpointSliceProxying` 特性门控控制。
在 Linux 上,从 Kubernetes 1.19 版本起自动启用。目前尚未在 Windows 节点
上默认启用。
要在 Windows 节点上配置 kube-proxy 使用 EndpointSlice,你需要为 kube-proxy 启用
`WindowsEndpointSliceProxying`
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
<!--
## Using Endpoint Slices
With Endpoint Slices fully enabled in your cluster, you should see corresponding
With EndpointSlices 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.
existing Endpoints functionality, EndpointSlices include new bits of information
such as topology. They will allow for greater scalability and extensibility of
network endpoints in your cluster.
-->
## 使用 EndpointSlice
## 使用端点切片
在集群中完全启用 EndpointSlice 的情况下,你应该看到对应于每个
Endpoints 资源的 EndpointSlice 资源。除了支持现有的 Endpoints 功能外,
EndpointSlice 还引入了拓扑结构等新的信息。它们将使集群中网络端点具有更强的
可伸缩性和可扩展性。
在集群中完全启用端点切片的情况下,您应该看到对应的每个端点资源的端点切片资源。除了兼容现有的端点功能,端点切片应包括拓扑等新的信息。它们将使集群中网络端点具有更强的可伸缩性,可扩展性。