You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/concepts/scheduling-eviction/topology-spread-constraints.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,17 @@ spec:
133
133
### 其他 Pod 字段置于此处
134
134
```
135
135
136
+
{{< note >}}
137
+
<!--
138
+
There can only be one `topologySpreadConstraint` for a given `topologyKey` and `whenUnsatisfiable` value. For example, if you have defined a `topologySpreadConstraint` that uses the `topologyKey` "kubernetes.io/hostname" and `whenUnsatisfiable` value "DoNotSchedule", you can only add another `topologySpreadConstraint` for the `topologyKey` "kubernetes.io/hostname" if you use a different `whenUnsatisfiable` value.
You can read more about this field by running `kubectl explain Pod.spec.topologySpreadConstraints` or
138
149
refer to [scheduling](/docs/reference/kubernetes-api/workload-resources/pod-v1/#scheduling) section of the API reference for Pod.
@@ -1025,6 +1036,26 @@ section of the enhancement proposal about Pod topology spread constraints.
1025
1036
1026
1037
你可以通过使用感知 Pod 拓扑分布约束并感知整个拓扑域集的节点自动扩缩工具来解决此问题。
1027
1038
1039
+
<!--
1040
+
- Pods that don't match their own labelSelector create "ghost pods". If a pod's
1041
+
labels don't match the `labelSelector` in its topology spread constraint, the pod
1042
+
won't count itself in spread calculations. This means:
1043
+
- Multiple such pods can just accumulate on the same topology (until matching pods are newly created/deleted) because those pod's schedule don't change a spreading calculation result.
1044
+
- The spreading constraint works in an unintended way, most likely not matching your expectations
1045
+
1046
+
Ensure your pod's labels match the `labelSelector` in your spread constraints.
1047
+
Typically, a pod should match its own topology spread constraint selector.
0 commit comments