Skip to content

Commit 925ea3a

Browse files
committed
[zh-cn]sync endpoint-slice-v1.md
Signed-off-by: xin.li <[email protected]>
1 parent f78b32b commit 925ea3a

File tree

1 file changed

+81
-32
lines changed

1 file changed

+81
-32
lines changed

content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1.md

Lines changed: 81 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ api_metadata:
44
import: "k8s.io/api/discovery/v1"
55
kind: "EndpointSlice"
66
content_type: "api_reference"
7-
description: "EndpointSlice 是实现某 Service 的端点的子集."
7+
description: "EndpointSlice 代表一组服务端点。"
88
title: "EndpointSlice"
99
weight: 3
1010
---
1111

1212
<!--
13-
description: "EndpointSlice represents a subset of the endpoints that implement a service."
13+
api_metadata:
14+
apiVersion: "discovery.k8s.io/v1"
15+
import: "k8s.io/api/discovery/v1"
16+
kind: "EndpointSlice"
17+
content_type: "api_reference"
18+
description: "EndpointSlice represents a set of service endpoints."
19+
title: "EndpointSlice"
20+
weight: 3
1421
-->
1522

1623
`apiVersion: discovery.k8s.io/v1`
@@ -20,10 +27,13 @@ description: "EndpointSlice represents a subset of the endpoints that implement
2027
## EndpointSlice {#EndpointSlice}
2128

2229
<!--
23-
EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.
30+
EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.
2431
-->
25-
EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有多个 EndpointSlice 对象与之对应,
26-
必须将所有的 EndpointSlice 拼接起来才能形成一套完整的端点集合。Service 通过标签来选择 EndpointSlice。
32+
EndpointSlice 表示一组服务端点。大多数 EndpointSlice 由 EndpointSlice
33+
控制器创建,用于表示被 Service 对象选中的 Pod。对于一个给定的服务,可能存在多个
34+
EndpointSlice 对象,这些对象必须被组合在一起以产生完整的端点集合;
35+
你可以通过在服务的命名空间中列出 `kubernetes.io/service-name`
36+
标签包含 Service 名称的 EndpointSlices 来找到给定 Service 的所有 slices。
2737

2838
<hr>
2939

@@ -41,7 +51,7 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
4151
- **addressType** (string), <!--required-->必需
4252

4353
<!--
44-
addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
54+
addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType "IPv4" and "IPv6". No semantics are defined for the "FQDN" type.
4555
-->
4656
addressType 指定当前 EndpointSlice 携带的地址类型。一个 EndpointSlice 只能携带同一类型的地址。
4757
EndpointSlice 对象创建完成后不可以再更改 addressType 字段。
@@ -50,6 +60,8 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
5060
* IPv4:表示 IPv4 地址。
5161
* IPv6:表示 IPv6 地址。
5262
* FQDN:表示完全限定域名。
63+
* (已弃用)EndpointSlice 控制器仅生成地址类型为 "IPv4" 和 "IPv6" 的切片,
64+
且 kube-proxy 也仅处理这些类型的切片。对于 "FQDN" 类型,未定义其语义。
5365

5466
- **endpoints** ([]Endpoint), <!--required-->必需
5567

@@ -79,12 +91,14 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
7991
**集合:不重复的值在合并期间会被保留**
8092

8193
<!--
82-
addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267
94+
addresses of this endpoint. For EndpointSlices of addressType "IPv4" or "IPv6", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.
8395
-->
8496

85-
本端点的地址。此字段的内容会根据对应的 EndpointSlice addressType 字段的值进行解释。
86-
消费者必须根据自身能力处理不同类型的地址。此字段必须至少包含 1 个地址,最多不超过 100 个地址。
87-
假定这些地址都是可替换的,而且客户端也可能选择只用第一个元素。参阅: https://issue.k8s.io/106267
97+
本端点的地址。对于地址类型为 "IPv4" 或 "IPv6" 的 EndpointSlices,
98+
值是规范形式的 IP 地址。其他地址类型值的语法和语义未定义。
99+
这必须包含至少一个地址但不超过 100 个。由 EndpointSlice 控制器生成的
100+
EndpointSlices 将始终只有 1 个地址。对于第一个之后的额外地址,未定义其语义,
101+
并且 kube-proxy 不会查看它们。
88102

89103
- **endpoints.conditions** (EndpointConditions)
90104

@@ -105,33 +119,32 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
105119
- **endpoints.conditions.ready** (boolean)
106120

107121
<!--
108-
ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be "true" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag.
122+
ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as "true". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.
109123
-->
110-
111-
ready 说明此端点已经准备好根据相关的系统映射接收流量。nil 值表示状态未知
112-
在大多数情况下,消费者应将这种未知状态视为就绪(ready)。
113-
考虑到兼容性,对于正在结束状态下的端点,永远不能将 ready 设置为“true”,
114-
除非正常的就绪行为被显式覆盖,例如当关联的服务设置了 publishNotReadyAddresses 标志时。
124+
125+
ready 说明此端点已经准备好根据相关的系统映射接收流量。nil 值应解释为 "true"
126+
通常,如果 endpoint 正在服务且未终止,则应将其标记为 ready
127+
尽管在某些情况下可以覆盖此设置,例如当关联的 Service 设置了
128+
publishNotReadyAddresses 标志时。
115129

116130
- **endpoints.conditions.serving** (boolean)
117131

118132
<!--
119-
serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.
133+
serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as "true".
120134
-->
121135
122-
serving 和 ready 非常相似。唯一的不同在于,
123-
即便某端点的状态为 Terminating 也可以设置 serving。
124-
对于处在终止过程中的就绪端点,此状况应被设置为 “true”。
125-
如果设置为 nil,则消费者应该以 ready 值为准。
136+
serving 表示此端点能够接收流量,根据管理端点的系统。对于由 Pod 支持的端点,
137+
如果 Pod 的 Ready 条件为 True,EndpointSlice 控制器会将端点标记为 serving。
138+
nil 值应解释为 "true"。
126139

127140
- **endpoints.conditions.terminating** (boolean)
128141

129142
<!--
130-
terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.
143+
terminating indicates that this endpoint is terminating. A nil value should be interpreted as "false".
131144
-->
132-
133-
terminating 说明当前端点正在终止过程中。nil 值表示状态未知。
134-
消费者应将这种未知状态视为端点并不处于终止过程中
145+
146+
terminating 说明当前端点正在终止过程中。
147+
nil 值应解释为 "false"
135148

136149
- **endpoints.deprecatedTopology** (map[string]string)
137150

@@ -161,6 +174,38 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
161174

162175
**EndpointHints 提供应该如何使用某端点的提示信息。**
163176

177+
- **endpoints.hints.forNodes** ([]ForNode)
178+
179+
<!--
180+
*Atomic: will be replaced during a merge*
181+
-->
182+
183+
**原子性:合并期间将被替换**
184+
185+
<!--
186+
forNodes indicates the node(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries. This is an Alpha feature and is only used when the PreferSameTrafficDistribution feature gate is enabled.
187+
-->
188+
189+
forNodes 表示在使用拓扑感知路由时,此端点应由哪个(些)节点消费。
190+
最多可能包含 8 个条目。这是一个 Alpha 级别特性,仅在启用了 PreferSameTrafficDistribution
191+
特性门控时使用。
192+
193+
<a name="ForNode"></a>
194+
195+
<!--
196+
*ForNode provides information about which nodes should consume this endpoint.*
197+
198+
- **endpoints.hints.forNodes.name** (string), required
199+
200+
name represents the name of the node.
201+
-->
202+
203+
**ForNode 提供关于哪个节点应调用此端点的信息。**
204+
205+
- **endpoints.hints.forNodes.name** (string),必需
206+
207+
name 表示节点的名称。
208+
164209
- **endpoints.hints.forZones** ([]ForZone)
165210

166211
<!--
@@ -170,10 +215,11 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
170215
**原子性:合并期间将被替换**
171216

172217
<!--
173-
forZones indicates the zone(s) this endpoint should be consumed by to enable topology aware routing.
218+
forZones indicates the zone(s) this endpoint should be consumed by when using topology aware routing. May contain a maximum of 8 entries.
174219
-->
175220
176-
forZones 表示应该由哪个可用区调用此端点从才能激活拓扑感知路由。
221+
forZones 表示在使用拓扑感知路由时,该端点应由哪个(些)区域消费。
222+
最多可能包含 8 个条目。
177223

178224
<a name="ForZone"></a>
179225

@@ -234,12 +280,14 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
234280
**原子性:合并期间会被替代**
235281

236282
<!--
237-
ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
283+
ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.
238284
-->
285+
239286

240287
ports 列出了当前 EndpointSlice 中各个端点所暴露的网络端口。每个端口的名称不得重复。
241-
当 ports 列表为空时,表示没有已经指定暴露哪些端口。如果端口值被定义为 nil,表示暴露“所有端口”。
242-
每个 EndpointSlice 最多可以包含 100 个端口。
288+
每个切片最多可能包含 100 个端口。Service 总是至少有 1 个端口,因此由 EndpointSlice
289+
控制器生成的 EndpointSlices 同样总是至少有 1 个端口。用于其他目的的 EndpointSlices
290+
可能有一个空的 ports 列表。
243291

244292
<a name="EndpointPort"></a>
245293

@@ -252,10 +300,11 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
252300
- **ports.port** (int32)
253301

254302
<!--
255-
port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.
303+
port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.
256304
-->
257305

258-
port 表示端点的端口号。如果未指定,就不限制端口,且必须根据消费者的具体环境进行解释。
306+
port 表示端点的端口号。如果 EndpointSlice 是从 Kubernetes 服务派生的,
307+
这必须设置为服务的目标端口。用于其他目的的 EndpointSlices 可能有一个 nil 端口。
259308

260309
- **ports.protocol** (string)
261310

0 commit comments

Comments
 (0)