[zh-cn] sync validating-admisson-policy service-v1
Signed-off-by: xin.li <xin.li@daocloud.io>pull/43822/head
parent
aef3a53641
commit
5e885da1e7
|
@ -551,47 +551,10 @@ CEL 表达式可以访问按 CEL 变量来组织的 Admission 请求/响应的
|
|||
<!--
|
||||
The `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from
|
||||
the root of the object. No other metadata properties are accessible.
|
||||
|
||||
Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
|
||||
Accessible property names are escaped according to the following rules when accessed in the
|
||||
expression:
|
||||
-->
|
||||
总是可以从对象的根访问的属性有 `apiVersion`、`kind`、`metadata.name` 和 `metadata.generateName`。
|
||||
其他元数据属性不能访问。
|
||||
|
||||
只有符合 `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` 形式的属性名称是可访问的。
|
||||
可访问的属性名称在表达式中被访问时,根据以下规则进行转义:
|
||||
|
||||
| 转义序列 | 属性名称等效 |
|
||||
| ----------------------- | -----------------------|
|
||||
| `__underscores__` | `__` |
|
||||
| `__dot__` | `.` |
|
||||
| `__dash__` | `-` |
|
||||
| `__slash__` | `/` |
|
||||
| `__{keyword}__` | [CEL 保留关键字](https://github.com/google/cel-spec/blob/v0.6.0/doc/langdef.md#syntax) |
|
||||
|
||||
{{< note >}}
|
||||
<!--
|
||||
A **CEL reserved** keyword only needs to be escaped if the token is an exact match
|
||||
for the reserved keyword.
|
||||
For example, `int` in the word “sprint” would not be escaped.
|
||||
-->
|
||||
**CEL 保留**关键字仅在字符串与保留关键字完全匹配时才需要转义。
|
||||
例如,单词 “sprint” 中的 `int` 不需要被转义。
|
||||
{{< /note >}}
|
||||
|
||||
<!--
|
||||
Examples on escaping:
|
||||
-->
|
||||
转义示例:
|
||||
|
||||
| 属性名 | 具有转义属性名称的规则 |
|
||||
| ----------- | --------------------------------- |
|
||||
| namespace | `self.__namespace__ > 0` |
|
||||
| x-prop | `self.x__dash__prop > 0` |
|
||||
| redact\_\_d | `self.redact__underscores__d > 0` |
|
||||
| string | `self.startsWith('kube')` |
|
||||
|
||||
<!--
|
||||
Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
|
||||
Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:
|
||||
|
|
|
@ -130,9 +130,9 @@ ServiceSpec 描述用户在服务上创建的属性。
|
|||
在 Service 所针对的 Pod 上要访问的端口号或名称。
|
||||
编号必须在 1 到 65535 的范围内。名称必须是 IANA_SVC_NAME。
|
||||
如果此值是一个字符串,将在目标 Pod 的容器端口中作为命名端口进行查找。
|
||||
如果未指定字段,则使用 "port” 字段的值(直接映射)。
|
||||
如果未指定字段,则使用 `port` 字段的值(直接映射)。
|
||||
对于 clusterIP 为 None 的服务,此字段将被忽略,
|
||||
应忽略不设或设置为 "port” 字段的取值。
|
||||
应忽略不设或设置为 `port` 字段的取值。
|
||||
更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
|
||||
|
||||
<a name="IntOrString"></a>
|
||||
|
@ -179,13 +179,32 @@ ServiceSpec 描述用户在服务上创建的属性。
|
|||
|
||||
- **ports.appProtocol** (string)
|
||||
|
||||
<!--
|
||||
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.
|
||||
<!--
|
||||
The application protocol for this port. This is used as a hint for implementations to offer
|
||||
richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax.
|
||||
Valid values are either:
|
||||
-->
|
||||
|
||||
此端口的应用协议,遵循标准的 Kubernetes 标签语法,无前缀名称按照 IANA 标准服务名称
|
||||
(参见 RFC-6335 和 https://www.iana.org/assignments/service-names)。
|
||||
非标准协议应该使用前缀名称,如 mycompany.com/my-custom-protocol。
|
||||
此端口的应用协议,用作实现的提示,为他们理解的协议提供更丰富的行为。此字段遵循标准
|
||||
Kubernetes 标签语法,有效值包括:
|
||||
|
||||
<!--
|
||||
* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).
|
||||
|
||||
* Kubernetes-defined prefixed names:
|
||||
* 'kubernetes.io/h2c' - HTTP/2 over cleartext as described in https://www.rfc-editor.org/rfc/rfc7540
|
||||
* 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455
|
||||
* 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455
|
||||
|
||||
* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.
|
||||
-->
|
||||
* 无前缀协议名称 - 保留用于 IANA 标准服务名称(根据 RFC-6335 和 https://www.iana.org/assignments/service-names)。
|
||||
|
||||
* Kubernetes 定义的前缀名称:
|
||||
* 'kubernetes.io/h2c' - HTTP/2 明文传输,如 https://www.rfc-editor.org/rfc/rfc7540 中所述。
|
||||
* 'kubernetes.io/ws' - 基于明文的 WebSocket,如 https://www.rfc-editor.org/rfc/rfc6455 中所述。
|
||||
* 'kubernetes.io/wss' - 基于 TLS 的 WebSocket,如 https://www.rfc-editor.org/rfc/rfc6455 中所述。
|
||||
|
||||
* 其他协议应使用实现定义的前缀名称,例如 mycompany.com/my-custom-protocol。
|
||||
|
||||
- **type** (string)
|
||||
|
||||
|
@ -195,12 +214,12 @@ ServiceSpec 描述用户在服务上创建的属性。
|
|||
|
||||
type 确定 Service 的公开方式。默认为 ClusterIP。
|
||||
有效选项为 ExternalName、ClusterIP、NodePort 和 LoadBalancer。
|
||||
“ClusterIP” 为端点分配一个集群内部 IP 地址用于负载均衡。
|
||||
`ClusterIP` 为端点分配一个集群内部 IP 地址用于负载均衡。
|
||||
Endpoints 由 selector 确定,如果未设置 selector,则需要通过手动构造 Endpoints 或 EndpointSlice 的对象来确定。
|
||||
如果 clusterIP 为 “None”,则不分配虚拟 IP,并且 Endpoints 作为一组端点而不是虚拟 IP 发布。
|
||||
“NodePort” 建立在 ClusterIP 之上,并在每个节点上分配一个端口,该端口路由到与 clusterIP 相同的 Endpoints。
|
||||
“LoadBalancer” 基于 NodePort 构建并创建一个外部负载均衡器(如果当前云支持),该负载均衡器路由到与 clusterIP 相同的 Endpoints。
|
||||
“externalName” 将此 Service 别名为指定的 externalName。其他几个字段不适用于 ExternalName Service。
|
||||
如果 clusterIP 为 `None`,则不分配虚拟 IP,并且 Endpoints 作为一组端点而不是虚拟 IP 发布。
|
||||
`NodePort` 建立在 ClusterIP 之上,并在每个节点上分配一个端口,该端口路由到与 clusterIP 相同的 Endpoints。
|
||||
`LoadBalancer` 基于 NodePort 构建并创建一个外部负载均衡器(如果当前云支持),该负载均衡器路由到与 clusterIP 相同的 Endpoints。
|
||||
`externalName` 将此 Service 别名为指定的 externalName。其他几个字段不适用于 ExternalName Service。
|
||||
更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
|
||||
|
||||
- **ipFamilies** ([]string)
|
||||
|
@ -245,7 +264,6 @@ ServiceSpec 描述用户在服务上创建的属性。
|
|||
ipFamilies 和 clusterIPs 字段取决于此字段的值。
|
||||
更新服务设置类型为 ExternalName 时,此字段将被擦除。
|
||||
|
||||
|
||||
- **clusterIP** (string)
|
||||
|
||||
<!--
|
||||
|
@ -317,13 +335,17 @@ ServiceSpec 描述用户在服务上创建的属性。
|
|||
- **loadBalancerIP** (string)
|
||||
|
||||
<!--
|
||||
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.
|
||||
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.
|
||||
Using it is non-portable and it may not support dual-stack. Users are encouraged to use
|
||||
implementation-specific annotations when available.
|
||||
-->
|
||||
|
||||
仅适用于服务类型: LoadBalancer。此功能取决于底层云提供商是否支持负载均衡器。
|
||||
仅适用于服务类型:LoadBalancer。此功能取决于底层云提供商是否支持负载均衡器。
|
||||
如果云提供商不支持该功能,该字段将被忽略。
|
||||
已弃用: 该字段信息不足,且其含义因实现而异,而且不支持双栈。
|
||||
从 Kubernetes v1.24 开始,鼓励用户在可用时使用特定于实现的注释。在未来的 API 版本中可能会删除此字段。
|
||||
已弃用:该字段信息不足,且其含义因实现而异。此字段是不可移植的,并且可能不支持双栈。。
|
||||
我们鼓励用户在可用时使用特定于实现的注解。
|
||||
|
||||
- **loadBalancerSourceRanges** ([]string)
|
||||
|
||||
|
@ -358,7 +380,7 @@ ServiceSpec 描述用户在服务上创建的属性。
|
|||
|
||||
externalName 是发现机制将返回的外部引用,作为此服务的别名(例如 DNS CNAME 记录)。
|
||||
不涉及代理。必须是小写的 RFC-1123 主机名 (https://tools.ietf.org/html/rfc1123),
|
||||
并且要求 `type` 为 “ExternalName”。
|
||||
并且要求 `type` 为 `ExternalName`。
|
||||
|
||||
- **externalTrafficPolicy** (string)
|
||||
|
||||
|
@ -620,6 +642,19 @@ ServiceStatus 表示 Service 的当前状态。
|
|||
-->
|
||||
|
||||
ip 是为基于 IP 的负载均衡器 Ingress 点(通常是 GCE 或 OpenStack 负载均衡器)设置的。
|
||||
|
||||
- **loadBalancer.ingress.ipMode** (string)
|
||||
|
||||
<!--
|
||||
IPMode specifies how the load-balancer IP behaves, and may only be specified when the ip field is specified.
|
||||
Setting this to "VIP" indicates that traffic is delivered to the node with the destination set to the load-balancer's IP and port.
|
||||
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
|
||||
port or the pod's IP and port. Service implementations may use this information to adjust traffic routing.
|
||||
-->
|
||||
ipMode 指定负载平衡器 IP 的行为方式,并且只能在设置了 ip 字段时指定。
|
||||
将其设置为 `VIP` 表示流量将传送到节点,并将目标设置为负载均衡器的 IP 和端口。
|
||||
将其设置为 `Proxy` 表示将流量传送到节点或 Pod,并将目标设置为节点的 IP 和节点端口或 Pod 的 IP 和端口。
|
||||
服务实现可以使用此信息来调整流量路由。
|
||||
|
||||
- **loadBalancer.ingress.ports** ([]PortStatus)
|
||||
|
||||
|
@ -627,7 +662,7 @@ ServiceStatus 表示 Service 的当前状态。
|
|||
*Atomic: will be replaced during a merge*
|
||||
-->
|
||||
|
||||
**Atomic: 将在合并期间被替换**
|
||||
**Atomic:将在合并期间被替换**
|
||||
|
||||
<!--
|
||||
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 的当前状态。
|
|||
Protocol is the protocol of the service port of which status is recorded here The supported values are: "TCP", "UDP", "SCTP"
|
||||
-->
|
||||
|
||||
protocol 是所记录的服务端口状态的协议。支持的值为:“TCP”、”UDP”、“SCTP”。
|
||||
protocol 是所记录的服务端口状态的协议。支持的值为:`TCP`、`UDP`、`SCTP`。
|
||||
|
||||
- **loadBalancer.ingress.ports.error** (string)
|
||||
|
||||
|
@ -670,7 +705,7 @@ ServiceStatus 表示 Service 的当前状态。
|
|||
-->
|
||||
|
||||
error 是记录 Service 端口的问题。
|
||||
错误的格式应符合以下规则:
|
||||
错误的格式应符合以下规则:
|
||||
- 内置错误原因应在此文件中指定,应使用 CamelCase 名称。
|
||||
- 云提供商特定错误原因的名称必须符合格式 foo.example.com/CamelCase。
|
||||
|
||||
|
@ -686,7 +721,7 @@ ServiceList 包含一个 Service 列表。
|
|||
|
||||
- **apiVersion**: v1
|
||||
|
||||
- **kind**: Service 列表
|
||||
- **kind**:Service 列表
|
||||
|
||||
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
|
||||
|
||||
|
@ -861,7 +896,7 @@ GET /api/v1/namespaces/{namespace}/services
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
-->
|
||||
- **sendInitialEvents** (**查询参数**): boolean
|
||||
- **sendInitialEvents** (**查询参数**):boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
|
||||
|
@ -982,7 +1017,7 @@ POST /api/v1/namespaces/{namespace}/services
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
|
||||
|
||||
- **body**: <a href="{{< ref "../service-resources/service-v1#Service" >}}">Service</a>,必需
|
||||
- **body**:<a href="{{< ref "../service-resources/service-v1#Service" >}}">Service</a>,必需
|
||||
|
||||
- **dryRun**(**查询参数**):string
|
||||
|
||||
|
|
Loading…
Reference in New Issue