From 9c9578410d1f623454fde4fef289111b44cb521d Mon Sep 17 00:00:00 2001
From: Michelle Wu <35519562+Michelle951@users.noreply.github.com>
Date: Mon, 11 Jul 2022 14:32:29 +0800
Subject: [PATCH] [zh-cn] translate
content/en/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1.md
---
.../service-resources/endpoint-slice-v1.md | 942 ++++++++++++++++++
1 file changed, 942 insertions(+)
create mode 100644 content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1.md
diff --git a/content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1.md b/content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1.md
new file mode 100644
index 0000000000..28dd358393
--- /dev/null
+++ b/content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1.md
@@ -0,0 +1,942 @@
+---
+api_metadata:
+ apiVersion: "discovery.k8s.io/v1"
+ import: "k8s.io/api/discovery/v1"
+ kind: "EndpointSlice"
+content_type: "api_reference"
+description: "EndpointSlice 是实现某 Service 的端点的子集."
+title: "EndpointSlice"
+weight: 3
+---
+
+
+
+`apiVersion: discovery.k8s.io/v1`
+
+`import "k8s.io/api/discovery/v1"`
+
+## EndpointSlice {#EndpointSlice}
+
+
+EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有多个 EndpointSlice 对象与之对应,
+必须将所有的 EndpointSlice 拼接起来才能形成一套完整的端点集合。Service 通过标签来选择 EndpointSlice。
+
+
+
+- **apiVersion**: discovery.k8s.io/v1
+
+- **kind**: EndpointSlice
+
+- **metadata** (}}">ObjectMeta)
+
+
+ 标准的对象元数据。
+
+- **addressType** (string), 必需
+
+
+ addressType 指定当前 EndpointSlice 携带的地址类型。一个 EndpointSlice 只能携带同一类型的地址。
+ EndpointSlice 对象创建完成后不可以再更改 addressType 字段。
+
+
+ 目前支持的地址类型为:
+
+ * IPv4:表示 IPv4 地址。
+ * IPv6:表示 IPv6 地址。
+ * FQDN:表示完全限定域名。
+
+- **endpoints** ([]Endpoint), 必需
+
+
+ **原子性:合并期间将被替换**
+
+
+ endpoints 是当前 EndpointSlice 中一组唯一的端点。每个 EndpointSlice 最多可以包含 1000 个端点。
+
+
+
+
+ **端点是实现某 Service 的一个逻辑“后端”。**
+
+ - **endpoints.addresses** ([]string), 必需
+
+
+
+ **集合:不重复的值在合并期间会被保留**
+
+
+
+ 本端点的地址。此字段的内容会根据对应的 EndpointSlice addressType 字段的值进行解释。
+ 消费者必须根据自身能力处理不同类型的地址。此字段必须至少包含 1 个地址,最多不超过 100 个地址。
+ 假定这些地址都是可替换的,而且客户端也可能选择只用第一个元素。参阅: https://issue.k8s.io/106267
+
+ - **endpoints.conditions** (EndpointConditions)
+
+
+
+ conditions 包含和本端点当前状态有关的信息。
+
+
+
+
+
+ **EndpointConditions 是端点的当前状况。**
+
+ - **endpoints.conditions.ready** (boolean)
+
+
+
+ ready 说明此端点已经准备好根据相关的系统映射接收流量。nil 值表示状态未知。
+ 在大多数情况下,消费者应将这种未知状态视为就绪(ready)。
+ 考虑到兼容性,对于正在结束状态下的端点,永远不能将 ready 设置为“true”。
+
+ - **endpoints.conditions.serving** (boolean)
+
+
+
+ serving 和 ready 非常相似。唯一的不同在于,
+ 即便某端点的状态为 Terminating 也可以设置 serving。
+ 对于处在终止过程中的就绪端点,此状况应被设置为 “true”。
+ 如果设置为 nil,则消费者应该以 ready 值为准。
+ 可以在 EndpointSliceTerminatingCondition 特性开关中启用此字段。
+
+ - **endpoints.conditions.terminating** (boolean)
+
+
+
+ terminating 说明当前端点正在终止过程中。nil 值表示状态未知。
+ 消费者应将这种未知状态视为端点并不处于终止过程中。
+ 可以通过 EndpointSliceTerminatingCondition 特性门控启用此字段。
+
+ - **endpoints.deprecatedTopology** (map[string]string)
+
+
+
+ deprecatedTopology 包含 v1beta1 API 的拓扑信息部分。目前已经弃用了此字段,
+ 移除 v1beta1 API 时(不早于 Kubernetes v1.24)会一起移除此字段。
+ 此字段目前仍然可以存储值,但是不能通过 v1 API 写入数据。
+ 向此字段写入数据的任何尝试都会被忽略,并且不会通知用户。
+ 移除此字段后,可以在 zone 和 nodeName 字段中查看拓扑信息。
+
+ - **endpoints.hints** (EndpointHints)
+
+
+
+ hints 是关于应该如何使用某端点的提示信息。
+
+
+
+
+
+ **EndpointHints 提供应该如何使用某端点的提示信息。**
+
+ - **endpoints.hints.forZones** ([]ForZone)
+
+
+
+ **原子性:合并期间将被替换**
+
+
+
+ forZones 表示应该由哪个可用区调用此端点从才能激活拓扑感知路由。
+
+
+
+
+
+ **ForZone 指示应该由哪些可用区调度此端点。**
+
+ - **endpoints.hints.forZones.name** (string), 必需
+
+
+
+ name 代表可用区的名称。
+
+ - **endpoints.hostname** (string)
+
+
+
+ 此端点的主机名称。端点的使用者可以通过此字段区分各个端点(例如,通过 DNS 域名)。
+ 使用同一主机名称的多个端点应被视为可替换(例如,DNS 中的多个 A 记录)。
+ 必须为小写字母,并且需要通过 DNS Label (RFC 1123) 验证。
+
+ - **endpoints.nodeName** (string)
+
+
+
+ nodeName 是托管此端点的 Node 的名称,使用 nodeName 可以决定 Node 本地有哪些端点。
+ 可以通过 EndpointSliceNodeName 特性门控启用此字段。
+
+ - **endpoints.targetRef** (}}">ObjectReference)
+
+
+
+ targetRef 是对代表此端点的 Kubernetes 对象的引用。
+
+ - **endpoints.zone** (string)
+
+
+
+ zone 是此端点所在的可用区(Zone)的名称。
+
+- **ports** ([]EndpointPort)
+
+
+
+ **原子性:合并期间会被替代**
+
+
+
+ ports 列出了当前 EndpointSlice 中各个端点所暴露的网络端口。每个端口的名称不得重复。
+ 当 ports 列表为空时,表示没有已经指定暴露哪些端口。如果端口值被定义为 nil,表示暴露“所有端口”。
+ 每个 EndpointSlice 最多可以包含 100 个端口。
+
+
+
+
+
+ **EndpointPort 是 EndpointSlice 使用的端口。**
+
+ - **ports.port** (int32)
+
+
+
+ 端点的端口号。如果未指定,就不限制端口,且必须根据消费者的具体环境进行解释。
+
+ - **ports.protocol** (string)
+
+
+
+ 此端口的 IP 协议。必须为 UDP、TCP 或 SCTP。默认为 TCP。
+
+ - **ports.name** (string)
+
+
+
+ 此端口的名称。EndpointSlice 中所有端口的名称都不得重复。
+ 如果 EndpointSlice 是基于 Kubernetes Service 创建的,
+ 那么此端口的名称和 Service.ports[].name 字段的值一致。默认为空字符串。
+ 名称必须是空字符串,或者必须通过 DNS_LABEL 验证:
+
+ * 最多包含 63 个字符。
+ * 必须包含英文小写字母或'-'。
+ * 必须以字母开头并以字母结尾。
+
+ - **ports.appProtocol** (string)
+
+
+
+ 此端口的应用层协议。此字段遵循标准的 Kubernetes Label 句法。
+ 不带前缀的名称是 IANA 标准服务的保留名称(参见 RFC-6335 和 https://www.iana.org/assignments/service-names)。
+ 非标准协议应该使用带前缀的名称,例如 mycompany.com/my-custom-protocol。
+
+## EndpointSliceList {#EndpointSliceList}
+
+
+EndpointSliceList 是 EndpointSlice 的列表。
+
+
+
+- **apiVersion**: discovery.k8s.io/v1
+
+- **kind**: EndpointSliceList
+
+- **metadata** (}}">ListMeta)
+
+
+ 标准的列表元数据
+
+- **items** ([]}}">EndpointSlice), 必需
+
+
+ EndpointSlice 列表
+
+
+## 操作 {#操作}
+
+
+
+
+### `get` 读取指定的 EndpointSlice
+
+
+#### HTTP 请求
+
+GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
+
+
+#### 参数
+
+
+- **name** (**路径参数**): string, 必需
+
+
+ EndpointSlice 的名称
+
+
+- **namespace** (**路径参数**): string, 必需
+
+ }}">namespace
+
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">EndpointSlice): OK
+
+401: Unauthorized
+
+
+### `list` 列举或监测 EndpointSlice 类别的对象
+
+
+#### HTTP 请求
+
+GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
+
+
+#### 参数
+
+
+- **namespace** (**路径参数**): string, 必需
+
+ }}">namespace
+
+
+- **allowWatchBookmarks** (**查询参数**): boolean
+
+ }}">allowWatchBookmarks
+
+
+- **continue** (**查询参数**): string
+
+ }}">continue
+
+
+- **fieldSelector** (**查询参数**): string
+
+ }}">fieldSelector
+
+
+- **labelSelector** (**查询参数**): string
+
+ }}">labelSelector
+
+
+- **limit** (**查询参数**): integer
+
+ }}">limit
+
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+
+- **resourceVersion** (**查询参数**): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (**查询参数**): string
+
+ }}">resourceVersionMatch
+
+
+
+- **timeoutSeconds** (*查询参数*): integer
+
+ }}">timeoutSeconds
+
+
+- **watch** (**查询参数**): boolean
+
+ }}">watch
+
+
+#### 响应
+
+200 (}}">EndpointSliceList): OK
+
+401: Unauthorized
+
+
+### `list` 列举或监测 EndpointSlice 类别的对象
+
+
+#### HTTP 请求
+
+GET /apis/discovery.k8s.io/v1/endpointslices
+
+
+#### 参数
+
+
+- **allowWatchBookmarks** (**查询参数**): boolean
+
+ }}">allowWatchBookmarks
+
+
+- **continue** (**查询参数**): string
+
+ }}">continue
+
+
+- **fieldSelector** (**查询参数**): string
+
+ }}">fieldSelector
+
+
+- **labelSelector** (**查询参数**): string
+
+ }}">labelSelector
+
+
+- **limit** (**查询参数**): integer
+ }}">limit
+
+
+- **pretty** (**查询参数**): string
+ }}">pretty
+
+
+- **resourceVersion** (**查询参数**): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (*查询参数*): string
+
+ }}">resourceVersionMatch
+
+
+- **timeoutSeconds** (**查询参数**): integer
+
+ }}">timeoutSeconds
+
+
+- **watch** (**查询参数**): boolean
+
+ }}">watch
+
+
+#### 响应
+
+200 (}}">EndpointSliceList): OK
+
+401: Unauthorized
+
+
+### `create` 创建 EndpointSlice
+
+
+#### HTTP 请求
+
+POST /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
+
+
+#### 参数
+
+
+- **namespace** (**路径参数**): string, 必需
+
+ }}">namespace
+
+- **body**: }}">EndpointSlice, 必需
+
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+
+- **fieldManager** (**查询参数**): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (**查询参数**): string
+
+ }}">fieldValidation
+
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">EndpointSlice): OK
+
+201 (}}">EndpointSlice): Created
+
+202 (}}">EndpointSlice): Accepted
+
+401: Unauthorized
+
+
+### `update` 替换指定的 EndpointSlice
+
+
+#### HTTP 请求
+
+PUT /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
+
+
+#### 参数
+
+
+- **name** (**路径参数**): string, 必需
+
+
+ EndpointSlice 的名称
+
+
+
+- **namespace** (**路径参数**): string, 必需
+
+ }}">namespace
+
+- **body**: }}">EndpointSlice,必需
+
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+
+- **fieldManager** (**查询参数**): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (**查询参数**): string-
+
+ }}">fieldValidation
+
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">EndpointSlice): OK
+
+201 (}}">EndpointSlice): Created
+
+401: Unauthorized
+
+
+### `patch` 部分更新指定的 EndpointSlice
+
+
+#### HTTP 请求
+
+PATCH /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
+
+
+#### 参数
+
+
+- **name** (**路径参数**): string, 必需
+
+
+ EndpointSlice 的名称
+
+
+- **namespace** (**路径参数**): string, 必需
+
+ }}">namespace
+
+- **body**: }}">Patch, 必需
+
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+
+- **fieldManager** (**查询参数**): string
+
+ }}">fieldManager
+
+
+- **fieldValidation** (**查询参数**): string
+
+ }}">fieldValidation
+
+
+- **force** (**查询参数**): boolean
+
+ }}">force
+
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+
+#### 响应
+
+200 (}}">EndpointSlice): OK
+
+201 (}}">EndpointSlice): Created
+
+401: Unauthorized
+
+
+### `delete` 删除 EndpointSlice
+
+
+#### HTTP 请求
+
+DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
+
+
+#### 参数
+
+
+- **name** (**路径参数**): string, 必需
+
+
+ EndpointSlice 的名称
+
+
+- **namespace** (**路径参数**): string, 必需
+
+ }}">namespace
+
+- **body**: }}">DeleteOptions
+
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+
+- **gracePeriodSeconds** (**查询参数**): integer
+
+ }}">gracePeriodSeconds
+
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+
+- **propagationPolicy** (**查询参数**): string
+
+ }}">propagationPolicy
+
+
+#### 响应
+
+200 (}}">Status): OK
+
+202 (}}">Status): Accepted
+
+401: Unauthorized
+
+
+### `deletecollection` 删除 EndpointSlice 的集合
+
+
+#### HTTP 请求
+
+DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
+
+
+#### 参数
+
+
+- **namespace** (**路径参数**): string, 必需
+
+ }}">namespace
+
+- **body**: }}">DeleteOptions
+
+
+- **continue** (**查询参数**): string
+
+ }}">continue
+
+
+- **dryRun** (**查询参数**): string
+
+ }}">dryRun
+
+
+- **fieldSelector** (**查询参数**): string
+
+ }}">fieldSelector
+
+
+- **gracePeriodSeconds** (**查询参数**): integer
+
+ }}">gracePeriodSeconds
+
+
+- **labelSelector** (**查询参数**): string
+
+ }}">labelSelector
+
+
+- **limit** (**查询参数**): integer
+
+ }}">limit
+
+
+- **pretty** (**查询参数**): string
+
+ }}">pretty
+
+
+- **propagationPolicy** (**查询参数**): string
+
+ }}">propagationPolicy
+
+
+- **resourceVersion** (**查询参数**): string
+
+ }}">resourceVersion
+
+
+- **resourceVersionMatch** (**查询参数**): string
+
+ }}">resourceVersionMatch
+
+
+- **timeoutSeconds** (**查询参数**): integer
+
+ }}">timeoutSeconds
+
+
+#### 响应
+
+200 (}}">Status): OK
+
+401: Unauthorized