From 1d04396e1a7608ed0e82f2dd419fd422ae4f8060 Mon Sep 17 00:00:00 2001 From: "xin.li" Date: Tue, 18 Nov 2025 21:11:27 +0800 Subject: [PATCH] [zh-cn]sync endpoints-v1 Signed-off-by: xin.li --- .../service-resources/endpoints-v1.md | 101 ++++++++++-------- 1 file changed, 59 insertions(+), 42 deletions(-) diff --git a/content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoints-v1.md b/content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoints-v1.md index e8029ae4f67c5..1510db9b31ee2 100644 --- a/content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoints-v1.md +++ b/content/zh-cn/docs/reference/kubernetes-api/service-resources/endpoints-v1.md @@ -31,17 +31,19 @@ Endpoints is a collection of endpoints that implement the actual service. Exampl --> Endpoints 是实现实际 Service 的端点的集合。举例: - Name: "mysvc", - Subsets: [ - { - Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], - Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] - }, - { - Addresses: [{"ip": "10.10.3.3"}], - Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] - }, - ] + ``` + Name: "mysvc", + Subsets: [ + { + Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], + Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] + }, + { + Addresses: [{"ip": "10.10.3.3"}], + Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] + }, +] +```
@@ -50,10 +52,10 @@ Endpoints is a legacy API and does not contain information about all Service fea Deprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice. --> -Endpoints 是遗留 API,不包含所有 Service 特性的信息。使用 discoveryv1.EndpointSlice +Endpoints 是遗留 API,不包含所有 Service 特性的信息。使用 `discoveryv1.EndpointSlice` 获取关于 Service 端点的完整信息。 -已弃用:此 API 在 v1.33+ 中已被弃用。请使用 discoveryv1.EndpointSlice。 +已弃用:此 API 在 v1.33+ 中已被弃用。请使用 `discoveryv1.EndpointSlice`。 - **apiVersion**: v1 @@ -75,32 +77,37 @@ Endpoints 是遗留 API,不包含所有 Service 特性的信息。使用 disco The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service. --> - **Atomic:将在合并期间被替换** + **原子性:将在合并期间被替换** - 所有端点的集合是所有 subsets 的并集。不同地址会根据其 IP 地址被放入不同子集。 + 所有端点的集合是所有 `subsets` 的并集。不同地址会根据其 IP 地址被放入不同子集。 对于具有多个端口的单个地址,如果其中一些端口已就绪,而另一些端口未就绪(因为它们来自不同的容器), 将导致地址显示在不同端口的不同子集中。 - 任何地址都不可以同时出现在 addresses 和 notReadyAddress 中的相同子集内。 + 任何地址都不可以同时出现在 `addresses` 和 `notReadyAddress` 中的相同子集内。 - **EndpointSubset 是一组具有公共端口集的地址。扩展的端点集是 addresses 和 ports 的笛卡尔乘积。例如假设:** + **EndpointSubset 是一组具有公共端口集的地址。扩展的端点集是 `addresses` 和 `ports` + 的笛卡尔乘积。例如假设:** - { - Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], - Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] - } + ``` + { + Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], + Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] + } + ``` 则最终的端点集可以看作: - a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], - b: [ 10.10.1.1:309, 10.10.2.2:309 ] + ``` + a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + ``` 此端口的 IP 协议。必须是 UDP、TCP 或 SCTP。默认值为 TCP。 - + + 可能的枚举值: + - `"SCTP"` 是 SCTP 协议 + - `"TCP"` 是 TCP 协议 + - `"UDP"` 是 UDP 协议 + - **subsets.ports.name** (string) - + @@ -266,7 +283,7 @@ Endpoints 是遗留 API,不包含所有 Service 特性的信息。使用 disco 仅当定义了一个端口时才可选。 - **subsets.ports.appProtocol** (string) - + @@ -276,24 +293,24 @@ Endpoints 是遗留 API,不包含所有 Service 特性的信息。使用 disco - + * 未加前缀的名称保留给 IANA 标准服务名称(遵循 RFC-6335 和 https://www.iana.org/assignments/service-names)。 - + * Kubernetes 定义的前缀名称 * 'kubernetes.io/h2c' - HTTP/2 明文,如 https://www.rfc-editor.org/rfc/rfc7540 中所述 * HTTP/2 通过明文预先了解知识,如 https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- 中所述 * 'kubernetes.io/ws' - WebSocket 明文,如 https://www.rfc-editor.org/rfc/rfc6455 中所述 * 'kubernetes.io/wss' - WebSocket TLS 传输方式,如 https://www.rfc-editor.org/rfc/rfc6455 中所述 - + * 其他协议应使用实现定义的前缀名称,如 mycompany.com/my-custom-protocol。 ## EndpointsList {#EndpointsList} @@ -327,7 +344,7 @@ EndpointsList 是端点列表。已弃用:此 API 在 v1.33+ 中已被弃用 --> - **items** ([]}}">Endpoints),必需 - 端点列表。 + 端点列表。 ## 操作 {#Operations} @@ -710,11 +727,11 @@ PUT /api/v1/namespaces/{namespace}/endpoints/{name} - **name** (**路径参数**):string,必需 - + Endpoints 名称 - **name** (**路径参数**):string,必需 - Endpoints 名称 + Endpoints 名称。