apply suggestion

This commit is contained in:
EricWvi
2021-08-16 15:13:31 +08:00
parent d1a502072e
commit cd9dc4e482
4 changed files with 26 additions and 18 deletions
@@ -557,15 +557,15 @@ If the feature gate `ExpandedDNSConfig` is enabled for the kube-apiserver and
the kubelet, it is allowed for Kubernetes to have at most 32 search domains and the kubelet, it is allowed for Kubernetes to have at most 32 search domains and
a list of search domains of up to 2048 characters. a list of search domains of up to 2048 characters.
--> -->
#### 扩展 DNS 配置 #### 扩展 DNS 配置 {#expanded-dns-configuration}
{{< feature-state for_k8s_version="1.22" state="alpha" >}} {{< feature-state for_k8s_version="1.22" state="alpha" >}}
对于 Pod DNS 配置,Kubernetes 默认允许最多 6 个 search domain 对于 Pod DNS 配置,Kubernetes 默认允许最多 6 个 搜索域( Search Domain
以及一个最多 256 个字符的 search domain 列表。 以及一个最多 256 个字符的搜索域列表。
如果启用 kube-apiserver 和 kubelet 的特性门控 `ExpandedDNSConfig`Kubernetes 将可以有最多 32 个 如果启用 kube-apiserver 和 kubelet 的特性门控 `ExpandedDNSConfig`Kubernetes 将可以有最多 32 个
search domain 以及一个最多 2048 个字符的 search domain 列表。 搜索域以及一个最多 2048 个字符的搜索域列表。
<!-- <!--
### Feature availability ### Feature availability
@@ -441,7 +441,7 @@ resources.
`scope` 设置为 `Namespace` 并设置 `namespace` 字段就可以引用某特定 `scope` 设置为 `Namespace` 并设置 `namespace` 字段就可以引用某特定
名字空间中的参数资源。 名字空间中的参数资源。
`scope` 设置为 `Namespace`不再需要为一个参数资源配置集群范围的 CustomResourceDefinition。 有了名字空间域的参数,就不再需要为一个参数资源配置集群范围的 CustomResourceDefinition。
除此之外,之前对访问集群范围的资源进行授权,需要用到 RBAC 相关的资源,现在也不再需要了。 除此之外,之前对访问集群范围的资源进行授权,需要用到 RBAC 相关的资源,现在也不再需要了。
{{< codenew file="service/networking/namespaced-params.yaml" >}} {{< codenew file="service/networking/namespaced-params.yaml" >}}
@@ -422,7 +422,7 @@ This ensures that even pods that aren't selected by any other NetworkPolicy will
As a stable feature, this is enabled by default. To disable SCTP at a cluster level, you (or your cluster administrator) will need to disable the `SCTPSupport` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the API server with `--feature-gates=SCTPSupport=false,…`. As a stable feature, this is enabled by default. To disable SCTP at a cluster level, you (or your cluster administrator) will need to disable the `SCTPSupport` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the API server with `--feature-gates=SCTPSupport=false,…`.
When the feature gate is enabled, you can set the `protocol` field of a NetworkPolicy to `SCTP`. When the feature gate is enabled, you can set the `protocol` field of a NetworkPolicy to `SCTP`.
--> -->
作为一个 Stable 特性,SCTP 支持默认是被启用的。 作为一个稳定特性,SCTP 支持默认是被启用的。
要在集群层面禁用 SCTP,你(或你的集群管理员)需要为 API 服务器指定 要在集群层面禁用 SCTP,你(或你的集群管理员)需要为 API 服务器指定
`--feature-gates=SCTPSupport=false,...` `--feature-gates=SCTPSupport=false,...`
来禁用 `SCTPSupport` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。 来禁用 `SCTPSupport` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)。
@@ -508,8 +508,8 @@ the policy will be applied only for the single `port` field.
--> -->
你的集群所使用的 {{< glossary_tooltip text="CNI" term_id="cni" >}} 插件 你的集群所使用的 {{< glossary_tooltip text="CNI" term_id="cni" >}} 插件
必须支持在 NetworkPolicy 规约中使用 `endPort` 字段。 必须支持在 NetworkPolicy 规约中使用 `endPort` 字段。
如果你的 [网络插件](/zh/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/) 如果你的[网络插件](/zh/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
不支持 `endPort` 字段的情况下,你指定一个 `endPort` 字段的网络策略 不支持 `endPort` 字段,你指定一个包含 `endPort` 字段的 NetworkPolicy
策略只对单个 `port` 字段生效。 策略只对单个 `port` 字段生效。
{{< /note >}} {{< /note >}}
@@ -325,7 +325,7 @@ the endpoints controller has truncated the number of endpoints to 1000.
如果某个 Endpoints 资源中包含的端点个数超过 1000,则 Kubernetes v1.22 版本 如果某个 Endpoints 资源中包含的端点个数超过 1000,则 Kubernetes v1.22 版本
(及更新版本)的集群会将为该 Endpoints 添加注解 (及更新版本)的集群会将为该 Endpoints 添加注解
`endpoints.kubernetes.io/over-capacity: truncated` `endpoints.kubernetes.io/over-capacity: truncated`
这一注解表明所影响到的 Endpoints 对象已经超出容量,此外 Endpoints Controller 还会将 Endpoints 对象数量截断到 1000。 这一注解表明所影响到的 Endpoints 对象已经超出容量,此外 Endpoints 控制器还会将 Endpoints 对象数量截断到 1000。
<!-- <!--
### EndpointSlices ### EndpointSlices
@@ -664,12 +664,12 @@ server will return a 422 HTTP status code to indicate that there's a problem.
<!-- <!--
## Traffic policies ## Traffic policies
--> -->
## 流量策略 ## 流量策略 {#traffic-policies}
<!-- <!--
### External traffic policy ### External traffic policy
--> -->
### 外部流量策略 ### 外部流量策略 {#external-traffic-policy}
<!-- <!--
You can set the `spec.externalTrafficPolicy` field to control how traffic from external sources is routed. You can set the `spec.externalTrafficPolicy` field to control how traffic from external sources is routed.
@@ -680,7 +680,8 @@ endpoints, the kube-proxy does not forward any traffic for the relevant Service.
你可以通过设置 `spec.externalTrafficPolicy` 字段来控制来自于外部的流量是如何路由的。 你可以通过设置 `spec.externalTrafficPolicy` 字段来控制来自于外部的流量是如何路由的。
可选值有 `Cluster``Local`。字段设为 `Cluster` 会将外部流量路由到所有就绪的端点, 可选值有 `Cluster``Local`。字段设为 `Cluster` 会将外部流量路由到所有就绪的端点,
设为 `Local` 会只路由到当前节点上就绪的端点。如果流量策略设置为 `Local`,而且当前节点上没有就绪的端点,kube-proxy 不会转发请求相关服务的任何流量。 设为 `Local` 会只路由到当前节点上就绪的端点。
如果流量策略设置为 `Local`,而且当前节点上没有就绪的端点,kube-proxy 不会转发请求相关服务的任何流量。
{{< note >}} {{< note >}}
{{< feature-state for_k8s_version="v1.22" state="alpha" >}} {{< feature-state for_k8s_version="v1.22" state="alpha" >}}
@@ -692,7 +693,9 @@ If you enable the `ProxyTerminatingEndpoints`
has local endpoints and whether or not all the local endpoints are marked as terminating. has local endpoints and whether or not all the local endpoints are marked as terminating.
--> -->
如果你启用了 kube-proxy 的 `ProxyTerminatingEndpoints` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)kube-proxy 会检查节点是否有本地的端点,以及是否所有的本地端点都被标记为终止中。 如果你启用了 kube-proxy 的 `ProxyTerminatingEndpoints`
[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
kube-proxy 会检查节点是否有本地的端点,以及是否所有的本地端点都被标记为终止中。
<!-- <!--
If there are local endpoints and **all** of those are terminating, then the kube-proxy ignores If there are local endpoints and **all** of those are terminating, then the kube-proxy ignores
@@ -701,7 +704,9 @@ terminating, the kube-proxy forwards traffic for that Service to healthy endpoin
as if the external traffic policy were set to `Cluster`. as if the external traffic policy were set to `Cluster`.
--> -->
如果本地有端点,而且所有端点处于终止中的状态,那么 kube-proxy 会忽略任何设为 `Local` 的外部流量策略。在所有本地端点处于终止中的状态的同时,kube-proxy 将请求指定服务的流量转发到位于其它节点的状态健康的端点,如同外部流量策略设为 `Cluster` 如果本地有端点,而且所有端点处于终止中的状态,那么 kube-proxy 会忽略任何设为 `Local` 的外部流量策略。
在所有本地端点处于终止中的状态的同时,kube-proxy 将请求指定服务的流量转发到位于其它节点的
状态健康的端点,如同外部流量策略设为 `Cluster`
<!-- <!--
This forwarding behavior for terminating endpoints exists to allow external load balancers to This forwarding behavior for terminating endpoints exists to allow external load balancers to
@@ -709,15 +714,16 @@ gracefully drain connections that are backed by `NodePort` Services, even when t
node port starts to fail. Otherwise, traffic can be lost between the time a node is still in the node pool of a load node port starts to fail. Otherwise, traffic can be lost between the time a node is still in the node pool of a load
balancer and traffic is being dropped during the termination period of a pod. balancer and traffic is being dropped during the termination period of a pod.
--> -->
在端点都处于终止中的情况下,这个转发行为使得外部负载均衡器可以优雅地排出由 `NodePort` 服务支持的连接,就算是健康检查节点端口开始失败也是如此。 针对处于正被终止状态的端点这一转发行为使得外部负载均衡器可以优雅地排出由
否则,在节点还在负载均衡器的节点池中,到一个 Pod 终止过程中正在丢弃流量之间,流量可能会丢失 `NodePort` 服务支持的连接,就算是健康检查节点端口开始失败也是如此
否则,当节点还在负载均衡器的节点池内,在 Pod 终止过程中的流量会被丢掉,这些流量可能会丢失。
{{< /note >}} {{< /note >}}
<!-- <!--
### Internal traffic policy ### Internal traffic policy
--> -->
### 内部流量策略 ### 内部流量策略 {#internal-traffic-policy}
{{< feature-state for_k8s_version="v1.22" state="beta" >}} {{< feature-state for_k8s_version="v1.22" state="beta" >}}
@@ -1209,7 +1215,9 @@ the cloud provider) will ignore Services that have this field set.
`spec.loadBalancerClass` can be set on a Service of type `LoadBalancer` only. `spec.loadBalancerClass` can be set on a Service of type `LoadBalancer` only.
Once set, it cannot be changed. Once set, it cannot be changed.
--> -->
`spec.loadBalancerClass` 允许你不使用云提供商的默认负载均衡器实现,转而使用指定的负载均衡器实现。这个特性从 v1.21 版本开始可以使用,你在 v1.21 版本中使用这个字段必须启用 `ServiceLoadBalancerClass` 特性门控,这个特性门控从 v1.22 版本及以后默认打开。 `spec.loadBalancerClass` 允许你不使用云提供商的默认负载均衡器实现,转而使用指定的负载均衡器实现。
这个特性从 v1.21 版本开始可以使用,你在 v1.21 版本中使用这个字段必须启用 `ServiceLoadBalancerClass`
特性门控,这个特性门控从 v1.22 版本及以后默认打开。
默认情况下,`.spec.loadBalancerClass` 的取值是 `nil`,如果集群使用 `--cloud-provider` 配置了云提供商, 默认情况下,`.spec.loadBalancerClass` 的取值是 `nil`,如果集群使用 `--cloud-provider` 配置了云提供商,
`LoadBalancer` 类型服务会使用云提供商的默认负载均衡器实现。 `LoadBalancer` 类型服务会使用云提供商的默认负载均衡器实现。
如果设置了 `.spec.loadBalancerClass`,则假定存在某个与所指定的类相匹配的 如果设置了 `.spec.loadBalancerClass`,则假定存在某个与所指定的类相匹配的