Skip to content

Commit 3c868f5

Browse files
authored
Merge pull request #43822 from my-git9/patch-12012
[zh-cn] sync validating-admisson-policy service-v1
2 parents af3ecd4 + 5e885da commit 3c868f5

File tree

2 files changed

+61
-63
lines changed

2 files changed

+61
-63
lines changed

content/zh-cn/docs/reference/access-authn-authz/validating-admission-policy.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -551,47 +551,10 @@ CEL 表达式可以访问按 CEL 变量来组织的 Admission 请求/响应的
551551
<!--
552552
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from
553553
the root of the object. No other metadata properties are accessible.
554-
555-
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
556-
Accessible property names are escaped according to the following rules when accessed in the
557-
expression:
558554
-->
559555
总是可以从对象的根访问的属性有 `apiVersion`、`kind`、`metadata.name` 和 `metadata.generateName`。
560556
其他元数据属性不能访问。
561557
562-
只有符合 `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` 形式的属性名称是可访问的。
563-
可访问的属性名称在表达式中被访问时,根据以下规则进行转义:
564-
565-
| 转义序列 | 属性名称等效 |
566-
| ----------------------- | -----------------------|
567-
| `__underscores__` | `__` |
568-
| `__dot__` | `.` |
569-
| `__dash__` | `-` |
570-
| `__slash__` | `/` |
571-
| `__{keyword}__` | [CEL 保留关键字](https://github.com/google/cel-spec/blob/v0.6.0/doc/langdef.md#syntax) |
572-
573-
{{< note >}}
574-
<!--
575-
A **CEL reserved** keyword only needs to be escaped if the token is an exact match
576-
for the reserved keyword.
577-
For example, `int` in the word “sprint” would not be escaped.
578-
-->
579-
**CEL 保留**关键字仅在字符串与保留关键字完全匹配时才需要转义。
580-
例如,单词 “sprint” 中的 `int` 不需要被转义。
581-
{{< /note >}}
582-
583-
<!--
584-
Examples on escaping:
585-
-->
586-
转义示例:
587-
588-
| 属性名 | 具有转义属性名称的规则 |
589-
| ----------- | --------------------------------- |
590-
| namespace | `self.__namespace__ > 0` |
591-
| x-prop | `self.x__dash__prop > 0` |
592-
| redact\_\_d | `self.redact__underscores__d > 0` |
593-
| string | `self.startsWith('kube')` |
594-
595558
<!--
596559
Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
597560
Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:

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

Lines changed: 61 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ ServiceSpec 描述用户在服务上创建的属性。
130130
在 Service 所针对的 Pod 上要访问的端口号或名称。
131131
编号必须在 1 到 65535 的范围内。名称必须是 IANA_SVC_NAME。
132132
如果此值是一个字符串,将在目标 Pod 的容器端口中作为命名端口进行查找。
133-
如果未指定字段,则使用 "port 字段的值(直接映射)。
133+
如果未指定字段,则使用 `port` 字段的值(直接映射)。
134134
对于 clusterIP 为 None 的服务,此字段将被忽略,
135-
应忽略不设或设置为 "port 字段的取值。
135+
应忽略不设或设置为 `port` 字段的取值。
136136
更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
137137

138138
<a name="IntOrString"></a>
@@ -179,13 +179,32 @@ ServiceSpec 描述用户在服务上创建的属性。
179179

180180
- **ports.appProtocol** (string)
181181

182-
<!--
183-
The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol.
182+
<!--
183+
The application protocol for this port. This is used as a hint for implementations to offer
184+
richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax.
185+
Valid values are either:
184186
-->
185-
186-
此端口的应用协议,遵循标准的 Kubernetes 标签语法,无前缀名称按照 IANA 标准服务名称
187-
(参见 RFC-6335 和 https://www.iana.org/assignments/service-names)。
188-
非标准协议应该使用前缀名称,如 mycompany.com/my-custom-protocol。
187+
此端口的应用协议,用作实现的提示,为他们理解的协议提供更丰富的行为。此字段遵循标准
188+
Kubernetes 标签语法,有效值包括:
189+
190+
<!--
191+
* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).
192+
193+
* Kubernetes-defined prefixed names:
194+
* 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540
195+
* 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455
196+
* 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455
197+
198+
* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.
199+
-->
200+
* 无前缀协议名称 - 保留用于 IANA 标准服务名称(根据 RFC-6335 和 https://www.iana.org/assignments/service-names)。
201+
202+
* Kubernetes 定义的前缀名称:
203+
* 'kubernetes.io/h2c' - HTTP/2 明文传输,如 https://www.rfc-editor.org/rfc/rfc7540 中所述。
204+
* 'kubernetes.io/ws' - 基于明文的 WebSocket,如 https://www.rfc-editor.org/rfc/rfc6455 中所述。
205+
* 'kubernetes.io/wss' - 基于 TLS 的 WebSocket,如 https://www.rfc-editor.org/rfc/rfc6455 中所述。
206+
207+
* 其他协议应使用实现定义的前缀名称,例如 mycompany.com/my-custom-protocol。
189208

190209
- **type** (string)
191210

@@ -195,12 +214,12 @@ ServiceSpec 描述用户在服务上创建的属性。
195214

196215
type 确定 Service 的公开方式。默认为 ClusterIP。
197216
有效选项为 ExternalName、ClusterIP、NodePort 和 LoadBalancer。
198-
ClusterIP 为端点分配一个集群内部 IP 地址用于负载均衡。
217+
`ClusterIP` 为端点分配一个集群内部 IP 地址用于负载均衡。
199218
Endpoints 由 selector 确定,如果未设置 selector,则需要通过手动构造 Endpoints 或 EndpointSlice 的对象来确定。
200-
如果 clusterIP 为 None,则不分配虚拟 IP,并且 Endpoints 作为一组端点而不是虚拟 IP 发布。
201-
NodePort 建立在 ClusterIP 之上,并在每个节点上分配一个端口,该端口路由到与 clusterIP 相同的 Endpoints。
202-
LoadBalancer 基于 NodePort 构建并创建一个外部负载均衡器(如果当前云支持),该负载均衡器路由到与 clusterIP 相同的 Endpoints。
203-
externalName 将此 Service 别名为指定的 externalName。其他几个字段不适用于 ExternalName Service。
219+
如果 clusterIP 为 `None`,则不分配虚拟 IP,并且 Endpoints 作为一组端点而不是虚拟 IP 发布。
220+
`NodePort` 建立在 ClusterIP 之上,并在每个节点上分配一个端口,该端口路由到与 clusterIP 相同的 Endpoints。
221+
`LoadBalancer` 基于 NodePort 构建并创建一个外部负载均衡器(如果当前云支持),该负载均衡器路由到与 clusterIP 相同的 Endpoints。
222+
`externalName` 将此 Service 别名为指定的 externalName。其他几个字段不适用于 ExternalName Service。
204223
更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
205224

206225
- **ipFamilies** ([]string)
@@ -245,7 +264,6 @@ ServiceSpec 描述用户在服务上创建的属性。
245264
ipFamilies 和 clusterIPs 字段取决于此字段的值。
246265
更新服务设置类型为 ExternalName 时,此字段将被擦除。
247266

248-
249267
- **clusterIP** (string)
250268

251269
<!--
@@ -317,13 +335,17 @@ ServiceSpec 描述用户在服务上创建的属性。
317335
- **loadBalancerIP** (string)
318336

319337
<!--
320-
Only applies to Service Type: LoadBalancer. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature. Deprecated: This field was under-specified and its meaning varies across implementations, and it cannot support dual-stack. As of Kubernetes v1.24, users are encouraged to use implementation-specific annotations when available. This field may be removed in a future API version.
338+
Only applies to Service Type: LoadBalancer. This feature depends on whether the underlying cloud-provider
339+
supports specifying the loadBalancerIP when a load balancer is created.
340+
This field will be ignored if the cloud-provider does not support the feature.
341+
Deprecated: This field was under-specified and its meaning varies across implementations.
342+
Using it is non-portable and it may not support dual-stack. Users are encouraged to use
343+
implementation-specific annotations when available.
321344
-->
322-
323-
仅适用于服务类型: LoadBalancer。此功能取决于底层云提供商是否支持负载均衡器。
345+
仅适用于服务类型:LoadBalancer。此功能取决于底层云提供商是否支持负载均衡器。
324346
如果云提供商不支持该功能,该字段将被忽略。
325-
已弃用: 该字段信息不足,且其含义因实现而异,而且不支持双栈
326-
从 Kubernetes v1.24 开始,鼓励用户在可用时使用特定于实现的注释。在未来的 API 版本中可能会删除此字段
347+
已弃用该字段信息不足,且其含义因实现而异。此字段是不可移植的,并且可能不支持双栈。
348+
我们鼓励用户在可用时使用特定于实现的注解
327349

328350
- **loadBalancerSourceRanges** ([]string)
329351

@@ -358,7 +380,7 @@ ServiceSpec 描述用户在服务上创建的属性。
358380

359381
externalName 是发现机制将返回的外部引用,作为此服务的别名(例如 DNS CNAME 记录)。
360382
不涉及代理。必须是小写的 RFC-1123 主机名 (https://tools.ietf.org/html/rfc1123),
361-
并且要求 `type`ExternalName
383+
并且要求 `type``ExternalName`
362384

363385
- **externalTrafficPolicy** (string)
364386

@@ -620,14 +642,27 @@ ServiceStatus 表示 Service 的当前状态。
620642
-->
621643

622644
ip 是为基于 IP 的负载均衡器 Ingress 点(通常是 GCE 或 OpenStack 负载均衡器)设置的。
645+
646+
- **loadBalancer.ingress.ipMode** (string)
647+
648+
<!--
649+
IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified.
650+
Setting this to "VIP" indicates that traffic is delivered to the node with the destination set to the load-balancer's IP and port.
651+
Setting this to "Proxy" indicates that traffic is delivered to the node or pod with the destination set to the node's IP and node
652+
port or the pod's IP and port. Service implementations may use this information to adjust traffic routing.
653+
-->
654+
ipMode 指定负载平衡器 IP 的行为方式,并且只能在设置了 ip 字段时指定。
655+
将其设置为 `VIP` 表示流量将传送到节点,并将目标设置为负载均衡器的 IP 和端口。
656+
将其设置为 `Proxy` 表示将流量传送到节点或 Pod,并将目标设置为节点的 IP 和节点端口或 Pod 的 IP 和端口。
657+
服务实现可以使用此信息来调整流量路由。
623658

624659
- **loadBalancer.ingress.ports** ([]PortStatus)
625660

626661
<!--
627662
*Atomic: will be replaced during a merge*
628663
-->
629664

630-
**Atomic: 将在合并期间被替换**
665+
**Atomic将在合并期间被替换**
631666

632667
<!--
633668
Ports is a list of records of service ports If used, every port defined in the service should have an entry in it -->
@@ -658,7 +693,7 @@ ServiceStatus 表示 Service 的当前状态。
658693
Protocol is the protocol of the service port of which status is recorded here The supported values are: "TCP", "UDP", "SCTP"
659694
-->
660695

661-
protocol 是所记录的服务端口状态的协议。支持的值为:TCP”、”UDP”、“SCTP
696+
protocol 是所记录的服务端口状态的协议。支持的值为:`TCP``UDP``SCTP`
662697

663698
- **loadBalancer.ingress.ports.error** (string)
664699

@@ -670,7 +705,7 @@ ServiceStatus 表示 Service 的当前状态。
670705
-->
671706

672707
error 是记录 Service 端口的问题。
673-
错误的格式应符合以下规则:
708+
错误的格式应符合以下规则
674709
- 内置错误原因应在此文件中指定,应使用 CamelCase 名称。
675710
- 云提供商特定错误原因的名称必须符合格式 foo.example.com/CamelCase。
676711

@@ -686,7 +721,7 @@ ServiceList 包含一个 Service 列表。
686721

687722
- **apiVersion**: v1
688723

689-
- **kind**: Service 列表
724+
- **kind**Service 列表
690725

691726
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
692727

@@ -861,7 +896,7 @@ GET /api/v1/namespaces/{namespace}/services
861896
862897
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
863898
-->
864-
- **sendInitialEvents** (**查询参数**): boolean
899+
- **sendInitialEvents** (**查询参数**)boolean
865900

866901
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
867902

@@ -982,7 +1017,7 @@ POST /api/v1/namespaces/{namespace}/services
9821017

9831018
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
9841019

985-
- **body**: <a href="{{< ref "../service-resources/service-v1#Service" >}}">Service</a>,必需
1020+
- **body**<a href="{{< ref "../service-resources/service-v1#Service" >}}">Service</a>,必需
9861021

9871022
- **dryRun****查询参数**):string
9881023

0 commit comments

Comments
 (0)