Skip to content

Commit cdce18d

Browse files
committed
[zh-cn]sync service-v1
Signed-off-by: xin.li <[email protected]>
1 parent 6ed7f6d commit cdce18d

1 file changed

Lines changed: 92 additions & 9 deletions

File tree

  • content/zh-cn/docs/reference/kubernetes-api/service-resources

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

Lines changed: 92 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,19 @@ ServiceSpec 描述用户在服务上创建的属性。
149149
-->
150150

151151
此端口的 IP 协议。支持 “TCP”、“UDP” 和 “SCTP”。默认为 TCP。
152+
153+
<!--
154+
Possible enum values:
155+
- `"SCTP"` is the SCTP protocol.
156+
- `"TCP"` is the TCP protocol.
157+
- `"UDP"` is the UDP protocol.
158+
-->
159+
160+
可能的枚举值:
161+
162+
- `"SCTP"` 是 SCTP 协议
163+
- `"TCP"` 是 TCP 协议
164+
- `"UDP"` 是 UDP 协议
152165

153166
- **ports.name** (string)
154167

@@ -222,6 +235,22 @@ ServiceSpec 描述用户在服务上创建的属性。
222235
`externalName` 将此 Service 别名为指定的 externalName。其他几个字段不适用于 ExternalName Service。更多信息:
223236
https://kubernetes.io/zh-cn/docs/concepts/services-networking/service/#publishing-services-service-types
224237

238+
<!--
239+
Possible enum values:
240+
- `"ClusterIP"` means a service will only be accessible inside the cluster, via the cluster IP.
241+
- `"ExternalName"` means a service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved.
242+
- `"LoadBalancer"` means a service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type.
243+
- `"NodePort"` means a service will be exposed on one port of every node, in addition to 'ClusterIP' type.
244+
-->
245+
246+
可能的枚举值:
247+
- `"ClusterIP"` 表示 Service 只能在集群内部通过集群 IP 访问。
248+
- `"ExternalName"` 表示 Service 仅包含一个对外部名称的引用,kube-dns 或等效组件会将其作为 CNAME 记录返回,
249+
不涉及任何 Pod 的暴露或代理。
250+
- `"LoadBalancer"` 表示 Service 将通过外部负载均衡器暴露(如果云提供商支持),
251+
除了 'NodePort' 类型外。
252+
- `"NodePort"` 表示 Service 将在每个节点的一个端口上暴露,除了 'ClusterIP' 类型外。
253+
225254
- **ipFamilies** ([]string)
226255

227256
<!--
@@ -264,6 +293,24 @@ ServiceSpec 描述用户在服务上创建的属性。
264293
ipFamilies 和 clusterIPs 字段取决于此字段的值。
265294
更新服务设置类型为 ExternalName 时,此字段将被擦除。
266295

296+
<!--
297+
Possible enum values:
298+
- `"PreferDualStack"` indicates that this service prefers dual-stack when the cluster is configured for dual-stack. If the cluster is not configured for dual-stack the service will be assigned a single IPFamily. If the IPFamily is not set in service.spec.ipFamilies then the service will be assigned the default IPFamily configured on the cluster
299+
- `"RequireDualStack"` indicates that this service requires dual-stack. Using IPFamilyPolicyRequireDualStack on a single stack cluster will result in validation errors. The IPFamilies (and their order) assigned to this service is based on service.spec.ipFamilies. If service.spec.ipFamilies was not provided then it will be assigned according to how they are configured on the cluster. If service.spec.ipFamilies has only one entry then the alternative IPFamily will be added by apiserver
300+
- `"SingleStack"` indicates that this service is required to have a single IPFamily. The IPFamily assigned is based on the default IPFamily used by the cluster or as identified by service.spec.ipFamilies field
301+
-->
302+
303+
可能的枚举值:
304+
- `"PreferDualStack"` 表示当集群配置为双栈时,此 Service 偏好使用双栈。
305+
如果集群未配置为双栈,则服务将被分配一个 IP 族。
306+
如果服务的 `spec.ipFamilies` 中未设置 IP 族,则 Service 将被分配集群上配置的默认 IP 家族。
307+
- `"RequireDualStack"` 表示此 Service 需要双栈。在单栈集群上使用 IPFamilyPolicyRequireDualStack
308+
将导致验证错误。分配给此服务的 IP 家族(及其顺序)基于 `service.spec.ipFamilies`
309+
如果未提供 `service.spec.ipFamilies`,则根据集群上的配置进行分配。
310+
如果 `service.spec.ipFamilies` 只有一个条目,则 apiserver 将添加另一个 IP 家族。
311+
- `"SingleStack"` 表示此 Service 必须只有一个 IP 家族。
312+
分配的 IP 家族基于集群使用的默认 IP 家族或由 `service.spec.ipFamilies` 字段指定。
313+
267314
- **clusterIP** (string)
268315

269316
<!--
@@ -337,6 +384,16 @@ ServiceSpec 描述用户在服务上创建的属性。
337384
启用基于客户端 IP 的会话亲和性。必须是 ClientIP 或 None。默认为 None。更多信息:
338385
https://kubernetes.io/zh-cn/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
339386

387+
<!--
388+
Possible enum values:
389+
- `"ClientIP"` is the Client IP based.
390+
- `"None"` - no session affinity.
391+
-->
392+
393+
可能的枚举值:
394+
- `"ClientIP"` 表示基于客户端 IP 的会话亲和性。
395+
- `"None"` 表示没有会话亲和性。
396+
340397
- **loadBalancerIP** (string)
341398

342399
<!--
@@ -401,6 +458,17 @@ ServiceSpec 描述用户在服务上创建的属性。
401458
“Cluster” 默认值使用负载均衡路由到所有端点的策略(可能会根据拓扑和其他特性进行修改)。
402459
请注意,从集群内部发送到 External IP 或 LoadBalancer IP 的流量始终具有 “Cluster” 语义,
403460
但是从集群内部发送到 NodePort 的客户端需要在选择节点时考虑流量路由策略。
461+
462+
<!--
463+
Possible enum values:
464+
- `"Cluster"` routes traffic to all endpoints.
465+
- `"Local"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).
466+
-->
467+
468+
可能的枚举值:
469+
- `"Cluster"` 路由流量到所有端点。
470+
- `"Local"` 通过仅路由到与接收流量相同的节点上的端点来保留流量的源 IP
471+
(如果没有本地端点,则丢弃流量)。
404472

405473
- **internalTrafficPolicy** (string)
406474

@@ -412,6 +480,16 @@ ServiceSpec 描述用户在服务上创建的属性。
412480
如果设置为 “Local”,代理将假定 Pod 只想与在同一节点上的服务端点通信,如果没有本地端点,它将丢弃流量。
413481
“Cluster” 默认将流量路由到所有端点(可能会根据拓扑和其他特性进行修改)。
414482

483+
<!--
484+
Possible enum values:
485+
- `"Cluster"` routes traffic to all endpoints.
486+
- `"Local"` routes traffic only to endpoints on the same node as the client pod (dropping the traffic if there are no local endpoints
487+
-->
488+
489+
可能的枚举值:
490+
- `"Cluster"` 路由流量到所有端点。
491+
- `"Local"` 仅将流量路由到与客户端 Pod 位于同一节点上的端点(如果没有本地端点,则丢弃流量)。
492+
415493
- **healthCheckNodePort** (int32)
416494

417495
<!--
@@ -617,7 +695,7 @@ ServiceStatus 表示 Service 的当前状态。
617695
*LoadBalancerStatus represents the status of a load-balancer.*
618696
-->
619697

620-
loadBalancer 包含负载均衡器的当前状态(如果存在)。
698+
`loadBalancer` 包含负载均衡器的当前状态(如果存在)。
621699

622700
<a name="LoadBalancerStatus"></a>
623701
**LoadBalancerStatus 表示负载均衡器的状态。**
@@ -635,7 +713,7 @@ ServiceStatus 表示 Service 的当前状态。
635713

636714
**原子:将在合并期间被替换**
637715

638-
ingress 是一个包含负载均衡器 Ingress 点的列表。Service 的流量需要被发送到这些 Ingress 点。
716+
`ingress` 是一个包含负载均衡器 Ingress 点的列表。Service 的流量需要被发送到这些 Ingress 点。
639717

640718
<a name="LoadBalancerIngress"></a>
641719
**LoadBalancerIngress 表示负载平衡器入口点的状态: 用于服务的流量是否被发送到入口点。**
@@ -646,15 +724,15 @@ ServiceStatus 表示 Service 的当前状态。
646724
Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)
647725
-->
648726

649-
hostname 是为基于 DNS 的负载均衡器 Ingress 点(通常是 AWS 负载均衡器)设置的。
727+
`hostname` 是为基于 DNS 的负载均衡器 Ingress 点(通常是 AWS 负载均衡器)设置的。
650728

651729
- **loadBalancer.ingress.ip** (string)
652730

653731
<!--
654732
IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)
655733
-->
656734

657-
ip 是为基于 IP 的负载均衡器 Ingress 点(通常是 GCE 或 OpenStack 负载均衡器)设置的。
735+
`ip` 是为基于 IP 的负载均衡器 Ingress 点(通常是 GCE 或 OpenStack 负载均衡器)设置的。
658736

659737
- **loadBalancer.ingress.ipMode** (string)
660738

@@ -665,7 +743,7 @@ ServiceStatus 表示 Service 的当前状态。
665743
port or the pod's IP and port. Service implementations may use this information to adjust traffic routing.
666744
-->
667745

668-
ipMode 指定负载平衡器 IP 的行为方式,并且只能在设置了 ip 字段时指定。
746+
`ipMode` 指定负载平衡器 IP 的行为方式,并且只能在设置了 ip 字段时指定。
669747
将其设置为 `VIP` 表示流量将传送到节点,并将目标设置为负载均衡器的 IP 和端口。
670748
将其设置为 `Proxy` 表示将流量传送到节点或 Pod,并将目标设置为节点的 IP 和节点端口或 Pod 的 IP 和端口。
671749
服务实现可以使用此信息来调整流量路由。
@@ -682,7 +760,7 @@ ServiceStatus 表示 Service 的当前状态。
682760
Ports is a list of records of service ports If used, every port defined in the service should have an entry in it
683761
-->
684762

685-
ports 是 Service 的端口列表。如果设置了此字段,Service 中定义的每个端口都应该在此列表中。
763+
`ports` 是 Service 的端口列表。如果设置了此字段,Service 中定义的每个端口都应该在此列表中。
686764

687765
<a name="PortStatus"></a>
688766

@@ -712,7 +790,12 @@ ServiceStatus 表示 Service 的当前状态。
712790
Protocol is the protocol of the service port of which status is recorded here The supported values are: "TCP", "UDP", "SCTP"
713791
-->
714792

715-
protocol 是所记录的服务端口状态的协议。支持的值为:“TCP”、“UDP”、“SCTP”。
793+
`protocol` 是所记录的服务端口状态的协议。支持的值为:“TCP”、“UDP”、“SCTP”。
794+
795+
可能的枚举值:
796+
- `"SCTP"` 是 SCTP 协议
797+
- `"TCP"` 是 TCP 协议
798+
- `"UDP"` 是 UDP 协议
716799

717800
- **loadBalancer.ingress.ports.error** (string)
718801

@@ -723,10 +806,10 @@ ServiceStatus 表示 Service 的当前状态。
723806
format foo.example.com/CamelCase.
724807
-->
725808

726-
error 是记录 Service 端口的问题。
809+
`error` 是记录 Service 端口的问题。
727810
错误的格式应符合以下规则:
728811
- 内置错误原因应在此文件中指定,应使用 CamelCase 名称。
729-
- 云提供商特定错误原因的名称必须符合格式 foo.example.com/CamelCase。
812+
- 云提供商特定错误原因的名称必须符合格式 `foo.example.com/CamelCase`
730813

731814
## ServiceList {#ServiceList}
732815

0 commit comments

Comments
 (0)