You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoint-slice-v1.md
+81-32Lines changed: 81 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,20 @@ api_metadata:
4
4
import: "k8s.io/api/discovery/v1"
5
5
kind: "EndpointSlice"
6
6
content_type: "api_reference"
7
-
description: "EndpointSlice 是实现某 Service 的端点的子集."
7
+
description: "EndpointSlice 代表一组服务端点。"
8
8
title: "EndpointSlice"
9
9
weight: 3
10
10
---
11
11
12
12
<!--
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
14
21
-->
15
22
16
23
`apiVersion: discovery.k8s.io/v1`
@@ -20,10 +27,13 @@ description: "EndpointSlice represents a subset of the endpoints that implement
20
27
## EndpointSlice {#EndpointSlice}
21
28
22
29
<!--
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 objectswhich 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.
24
31
-->
25
-
EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有多个 EndpointSlice 对象与之对应,
标签包含 Service 名称的 EndpointSlices 来找到给定 Service 的所有 slices。
27
37
28
38
<hr>
29
39
@@ -41,7 +51,7 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
41
51
-**addressType** (string), <!--required-->必需
42
52
43
53
<!--
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.
@@ -79,12 +91,14 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
79
91
**集合:不重复的值在合并期间会被保留**
80
92
81
93
<!--
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.
@@ -105,33 +119,32 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
105
119
-**endpoints.conditions.ready** (boolean)
106
120
107
121
<!--
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.
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".
120
134
-->
121
135
122
-
serving 和 ready 非常相似。唯一的不同在于,
123
-
即便某端点的状态为 Terminating 也可以设置 serving。
124
-
对于处在终止过程中的就绪端点,此状况应被设置为 “true”。
125
-
如果设置为 nil,则消费者应该以 ready 值为准。
136
+
serving 表示此端点能够接收流量,根据管理端点的系统。对于由 Pod 支持的端点,
137
+
如果 Pod 的 Ready 条件为 True,EndpointSlice 控制器会将端点标记为 serving。
138
+
nil 值应解释为 "true"。
126
139
127
140
-**endpoints.conditions.terminating** (boolean)
128
141
129
142
<!--
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".
@@ -161,6 +174,38 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
161
174
162
175
**EndpointHints 提供应该如何使用某端点的提示信息。**
163
176
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.
@@ -170,10 +215,11 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
170
215
**原子性:合并期间将被替换**
171
216
172
217
<!--
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.
174
219
-->
175
220
176
-
forZones 表示应该由哪个可用区调用此端点从才能激活拓扑感知路由。
221
+
forZones 表示在使用拓扑感知路由时,该端点应由哪个(些)区域消费。
222
+
最多可能包含 8 个条目。
177
223
178
224
<aname="ForZone"></a>
179
225
@@ -234,12 +280,14 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
234
280
**原子性:合并期间会被替代**
235
281
236
282
<!--
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.
@@ -252,10 +300,11 @@ EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有
252
300
-**ports.port** (int32)
253
301
254
302
<!--
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.
256
304
-->
257
305
258
-
port 表示端点的端口号。如果未指定,就不限制端口,且必须根据消费者的具体环境进行解释。
306
+
port 表示端点的端口号。如果 EndpointSlice 是从 Kubernetes 服务派生的,
0 commit comments