Skip to content

Commit

Permalink
sync service storage-classes configure-pdb
Browse files Browse the repository at this point in the history
  • Loading branch information
asa3311 committed Jul 15, 2023
1 parent 1c28e2d commit b76dc83
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
8 changes: 5 additions & 3 deletions content/zh-cn/docs/concepts/services-networking/service.md
Expand Up @@ -195,15 +195,17 @@ spec:
```

<!--
Applying this manifest creates a new Service named "my-service", which
Applying this manifest creates a new Service named "my-service" with the default
ClusterIP [service type](#publishing-services-service-types). The Service
targets TCP port 9376 on any Pod with the `app.kubernetes.io/name: MyApp` label.
Kubernetes assigns this Service an IP address (the _cluster IP_),
that is used by the virtual IP address mechanism. For more details on that mechanism,
read [Virtual IPs and Service Proxies](/docs/reference/networking/virtual-ips/).
-->
应用上述清单将创建一个名称为 "my-service" 的新 Service,它在所有 Pod 上指向
TCP 端口 9376,并且具有标签 `app.kubernetes.io/name: MyApp`
应用上述清单将创建一个名称为 "my-service" 的新 Service,
该服务[服务类型](#publishing-services-service-types)默认为 ClusterIP。
该服务指向带有标签 `app.kubernetes.io/name: MyApp` 的所有 Pod 的TCP 端口 9376。

Kubernetes 为该服务分配一个 IP 地址(有时称为 “集群 IP”),该 IP 地址由虚拟 IP 地址机制使用。
有关该机制的更多详情,请阅读[虚拟 IP 和服务代理](/zh-cn/docs/reference/networking/virtual-ips/)
Expand Down
12 changes: 11 additions & 1 deletion content/zh-cn/docs/concepts/storage/storage-classes.md
Expand Up @@ -560,9 +560,19 @@ using `allowedTopologies`.
{{< note >}}
<!--
`zone` and `zones` parameters are deprecated and replaced with
[allowedTopologies](#allowed-topologies)
[allowedTopologies](#allowed-topologies). When
[GCE CSI Migration](/docs/concepts/storage/volumes/#gce-csi-migration) is
enabled, a GCE PD volume can be provisioned in a topology that does not match
any nodes, but any pod trying to use that volume will fail to schedule. With
legacy pre-migration GCE PD, in this case an error will be produced
instead at provisioning time. GCE CSI Migration is enabled by default beginning
from the Kubernetes 1.23 release.
-->
`zone``zones` 已被弃用并被 [allowedTopologies](#allowed-topologies) 取代。
当启用 [GCE CSI 迁移](/zh-cn/docs/concepts/storage/volumes/#gce-csi-migration)时,
GCE PD 卷可能被制备在某个与所有节点都不匹配的拓扑域中,但任何尝试使用该卷的 Pod 都无法被调度。
对于传统的迁移前 GCE PD,这种情况下将在制备卷的时候产生错误。
从 Kubernetes 1.23 版本开始,GCE CSI 迁移默认启用。
{{< /note >}}

### NFS {#nfs}
Expand Down
39 changes: 24 additions & 15 deletions content/zh-cn/docs/tasks/run-application/configure-pdb.md
Expand Up @@ -95,10 +95,10 @@ is enabled.
<!--
You can also use PDBs with pods which are not controlled by one of the above
controllers, or arbitrary groups of pods, but there are some restrictions,
described in [Arbitrary Controllers and Selectors](#arbitrary-controllers-and-selectors).
described in [Arbitrary workloads and arbitrary selectors](#arbitrary-controllers-and-selectors).
-->
用户也可以用 PDB 来保护不受上述控制器控制的 Pod,或任意的 Pod 集合,但是正如
[任意控制器和选择算符](#arbitrary-controllers-and-selectors)中描述的,这里存在一些限制。
[任意工作负载和任意选择算符](#arbitrary-controllers-and-selectors)中描述的,这里存在一些限制。

<!--
## Think about how your application reacts to disruptions
Expand Down Expand Up @@ -509,23 +509,27 @@ Pods in `Pending`, `Succeeded` or `Failed` phase are always considered for evict
{{< /note >}}

<!--
## Arbitrary Controllers and Selectors
## Arbitrary workloads and arbitrary selectors {#arbitrary-controllers-and-selectors}
You can skip this section if you only use PDBs with the built-in
application controllers (Deployment, ReplicationController, ReplicaSet, and StatefulSet),
with the PDB selector matching the controller's selector.
workload resources (Deployment, ReplicaSet, StatefulSet and ReplicationController)
or with {{< glossary_tooltip term_id="CustomResourceDefinition" text="custom resources" >}}
that implement a `scale` [subresource](/docs/concepts/extend-kubernetes/api-extension/custom-resources/#advanced-features-and-flexibility),
and where the PDB selector exactly matches the selector of the Pod's owning resource.
-->
## 任意控制器和选择算符 {#arbitrary-controllers-and-selectors}
## 任意工作负载和任意选择算符 {#arbitrary-controllers-and-selectors}

如果你只使用与内置的应用控制器(Deployment、ReplicationController、ReplicaSet 和 StatefulSet)
对应的 PDB,也就是 PDB 的选择算符与 控制器的选择算符相匹配,那么可以跳过这一节。
如果你只针对内置的工作负载资源(Deployment、ReplicaSet、StatefulSet 和 ReplicationController)
或在实现了 `scale` [子资源](/zh-cn/docs/concepts/extend-kubernetes/api-extension/custom-resources/#advanced-features-and-flexibility)
的{{< glossary_tooltip term_id="CustomResourceDefinition" text="自定义资源" >}}使用 PDB,
并且 PDB 选择算符与 Pod 所属资源的选择算符完全匹配,那么可以跳过这一节。

<!--
You can use a PDB with pods controlled by another type of controller, by an
You can use a PDB with pods controlled by another resource, by an
"operator", or bare pods, but with these restrictions:
-->
你可以使用这样的 PDB:它对应的 Pod 可能由其他类型的控制器控制,可能由 "operator" 控制,
也可能为“裸的(不受控制器控制)” Pod,但该类 PDB 存在以下限制
你可以针对由其他资源、某个 "operator" 控制的或者“裸的(不受控制器控制)” Pod
使用 PDB,但存在以下限制

<!--
- only `.spec.minAvailable` can be used, not `.spec.maxUnavailable`.
Expand All @@ -535,11 +539,16 @@ You can use a PDB with pods controlled by another type of controller, by an
- 只能够使用整数作为 `.spec.minAvailable` 的值,而不能使用百分比。

<!--
You can use a selector which selects a subset or superset of the pods belonging to a built-in
controller. The eviction API will disallow eviction of any pod covered by multiple PDBs,
It is not possible to use other availability configurations,
because Kubernetes cannot derive a total number of pods without a supported owning resource.
You can use a selector which selects a subset or superset of the pods belonging to a
workload resource. The eviction API will disallow eviction of any pod covered by multiple PDBs,
so most users will want to avoid overlapping selectors. One reasonable use of overlapping
PDBs is when pods are being transitioned from one PDB to another.
-->
你可以令选择算符选择一个内置控制器所控制 Pod 的子集或父集。
你无法使用其他的可用性配置,因为如果没有被支持的属主资源,Kubernetes 无法推导出 Pod 的总数。

你可以使用能够选择属于工作负载资源的 Pod 的子集或超集的选择算符。
驱逐 API 将不允许驱逐被多个 PDB 覆盖的任何 Pod,因此大多数用户都希望避免重叠的选择算符。
重叠 PDB 的一种合理用途是当 Pod 从一个 PDB 过渡到另一个 PDB 时再使用
重叠 PDB 的一种合理用途是将 Pod 从一个 PDB 转交到另一个 PDB 的场合

0 comments on commit b76dc83

Please sign in to comment.