Skip to content

Commit e82d69b

Browse files
authored
Merge pull request #39285 from Zhuzhenghao/topology-spread-constraints
[zh] Resync topology-spread-constraints.md
2 parents d17b047 + c4771c9 commit e82d69b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

content/zh-cn/docs/concepts/scheduling-eviction/topology-spread-constraints.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ content_type: concept
44
weight: 40
55
---
66

7-
<!--
7+
<!--
88
title: Pod Topology Spread Constraints
99
content_type: concept
10-
weight: 40
10+
weight: 40
1111
-->
1212

1313
<!-- overview -->
1414

15-
<!--
15+
<!--
1616
You can use _topology spread constraints_ to control how
1717
{{< glossary_tooltip text="Pods" term_id="Pod" >}} are spread across your cluster
1818
among failure-domains such as regions, zones, nodes, and other user-defined topology
1919
domains. This can help to achieve high availability as well as efficient resource
2020
utilization.
2121
2222
You can set [cluster-level constraints](#cluster-level-default-constraints) as a default,
23-
or configure topology spread constraints for individual workloads.
23+
or configure topology spread constraints for individual workloads.
2424
-->
2525
你可以使用 **拓扑分布约束(Topology Spread Constraints)** 来控制
2626
{{< glossary_tooltip text="Pod" term_id="Pod" >}} 在集群内故障域之间的分布,
@@ -31,7 +31,7 @@ or configure topology spread constraints for individual workloads.
3131

3232
<!-- body -->
3333

34-
<!--
34+
<!--
3535
## Motivation
3636
3737
Imagine that you have a cluster of up to twenty nodes, and you want to run a
@@ -43,7 +43,7 @@ same node: you would run the risk that a single node failure takes your workload
4343
offline.
4444
4545
In addition to this basic usage, there are some advanced usage examples that
46-
enable your workloads to benefit on high availability and cluster utilization.
46+
enable your workloads to benefit on high availability and cluster utilization.
4747
-->
4848
## 动机 {#motivation}
4949

@@ -55,7 +55,7 @@ enable your workloads to benefit on high availability and cluster utilization.
5555

5656
除了这个基本的用法之外,还有一些高级的使用案例,能够让你的工作负载受益于高可用性并提高集群利用率。
5757

58-
<!--
58+
<!--
5959
As you scale up and run more Pods, a different concern becomes important. Imagine
6060
that you have three nodes running five Pods each. The nodes have enough capacity
6161
to run that many replicas; however, the clients that interact with this workload
@@ -81,7 +81,7 @@ Pod topology spread constraints offer you a declarative way to configure that.
8181

8282
Pod 拓扑分布约束使你能够以声明的方式进行配置。
8383

84-
<!--
84+
<!--
8585
## `topologySpreadConstraints` field
8686
8787
The Pod API includes a field, `spec.topologySpreadConstraints`. The usage of this field looks like
@@ -111,15 +111,15 @@ spec:
111111
### 其他 Pod 字段置于此处
112112
```
113113

114-
<!--
114+
<!--
115115
You can read more about this field by running `kubectl explain Pod.spec.topologySpreadConstraints` or
116116
refer to [scheduling](/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling) section of the API reference for Pod.
117117
-->
118118
你可以运行 `kubectl explain Pod.spec.topologySpreadConstraints` 或参阅 Pod API
119119
参考的[调度](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling)一节,
120120
了解有关此字段的更多信息。
121121

122-
<!--
122+
<!--
123123
### Spread constraint definition
124124
125125
You can define one or multiple `topologySpreadConstraints` entries to instruct the
@@ -147,7 +147,7 @@ your cluster. Those fields are:
147147
-->
148148
- **maxSkew** 描述这些 Pod 可能被均匀分布的程度。你必须指定此字段且该数值必须大于零。
149149
其语义将随着 `whenUnsatisfiable` 的值发生变化:
150-
150+
151151
- 如果你选择 `whenUnsatisfiable: DoNotSchedule`,则 `maxSkew` 定义目标拓扑中匹配 Pod 的数量与
152152
**全局最小值**(符合条件的域中匹配的最小 Pod 数量,如果符合条件的域数量小于 MinDomains 则为零)
153153
之间的最大允许差值。例如,如果你有 3 个可用区,分别有 2、2 和 1 个匹配的 Pod,则 `MaxSkew` 设为 1,
@@ -161,7 +161,7 @@ your cluster. Those fields are:
161161
-->
162162
- **minDomains** 表示符合条件的域的最小数量。此字段是可选的。域是拓扑的一个特定实例。
163163
符合条件的域是其节点与节点选择器匹配的域。
164-
164+
165165
{{< note >}}
166166
<!--
167167
The `minDomains` field is a beta field and disabled by default in 1.25. You can enable it by enabling the
@@ -171,7 +171,7 @@ your cluster. Those fields are:
171171
你可以通过启用 `MinDomainsInPodTopologySpread`
172172
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)来启用该字段。
173173
{{< /note >}}
174-
174+
175175
<!--
176176
- The value of `minDomains` must be greater than 0, when specified.
177177
You can only specify `minDomains` in conjunction with `whenUnsatisfiable: DoNotSchedule`.
@@ -276,10 +276,10 @@ your cluster. Those fields are:
276276

277277
{{< note >}}
278278
<!--
279-
The `nodeAffinityPolicy` is an alpha-level field added in 1.25. You can disable it by disabling the
279+
The `nodeAffinityPolicy` is a beta-level field and enabled by default in 1.26. You can disable it by disabling the
280280
`NodeInclusionPolicyInPodTopologySpread` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
281281
-->
282-
`nodeAffinityPolicy` 是 1.25 中新增的一个 Alpha 级别字段。
282+
`nodeAffinityPolicy` 是 1.26 中默认启用的一个 Beta 级别字段。
283283
你可以通过禁用 `NodeInclusionPolicyInPodTopologySpread`
284284
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)来禁用此字段。
285285
{{< /note >}}
@@ -727,7 +727,7 @@ There are some implicit conventions worth noting here:
727727
- 只有与新来的 Pod 具有相同命名空间的 Pod 才能作为匹配候选者。
728728
729729
- 调度器会忽略没有任何 `topologySpreadConstraints[*].topologyKey` 的节点。这意味着:
730-
730+
731731
1. 位于这些节点上的 Pod 不影响 `maxSkew` 计算,在上面的例子中,假设节点 `node1` 没有标签 "zone",
732732
则 2 个 Pod 将被忽略,因此新来的 Pod 将被调度到可用区 `A` 中。
733733
2. 新的 Pod 没有机会被调度到这类节点上。在上面的例子中,
@@ -904,8 +904,8 @@ Pod 彼此的调度方式(更密集或更分散)。
904904

905905
`podAntiAffinity`
906906
: 驱逐 Pod。如果将此设为 `requiredDuringSchedulingIgnoredDuringExecution` 模式,
907-
则只有单个 Pod 可以调度到单个拓扑域;如果你选择 `preferredDuringSchedulingIgnoredDuringExecution`,
908-
则你将丢失强制执行此约束的能力。
907+
则只有单个 Pod 可以调度到单个拓扑域;如果你选择 `preferredDuringSchedulingIgnoredDuringExecution`,
908+
则你将丢失强制执行此约束的能力。
909909

910910
<!--
911911
For finer control, you can specify topology spread constraints to distribute
@@ -937,7 +937,7 @@ section of the enhancement proposal about Pod topology spread constraints.
937937
## 已知局限性 {#known-limitations}
938938

939939
- 当 Pod 被移除时,无法保证约束仍被满足。例如,缩减某 Deployment 的规模时,Pod 的分布可能不再均衡。
940-
940+
941941
你可以使用 [Descheduler](https://github.com/kubernetes-sigs/descheduler) 来重新实现 Pod 分布的均衡。
942942

943943
- 具有污点的节点上匹配的 Pod 也会被统计。

0 commit comments

Comments
 (0)