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/en/docs/concepts/workloads/pods/pod-topology-spread-constraints.md
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,16 +73,42 @@ You can define one or multiple `topologySpreadConstraint` to instruct the kube-s
73
73
74
74
- **maxSkew** describes the degree to which Pods may be unevenly distributed.
75
75
It must be greater than zero. Its semantics differs according to the value of `whenUnsatisfiable`:
76
+
76
77
- when `whenUnsatisfiable` equals to "DoNotSchedule", `maxSkew` is the maximum
77
78
permitted difference between the number of matching pods in the target
78
79
topology and the global minimum
79
-
(the minimum number of pods that match the label selector in a topology domain. For example, if you have 3 zones with 0, 2 and 3 matching pods respectively, The global minimum is 0).
80
+
(the minimum number of pods that match the label selector in a topology domain.
81
+
For example, if you have 3 zones with 0, 2 and 3 matching pods respectively,
82
+
The global minimum is 0).
80
83
- when `whenUnsatisfiable` equals to "ScheduleAnyway", scheduler gives higher
81
84
precedence to topologies that would help reduce the skew.
85
+
86
+
- **minDomains** indicates a minimum number of eligible domains.
87
+
A domain is a particular instance of a topology. An eligible domain is a domain whose
88
+
nodes match the node selector.
89
+
90
+
- The value of `minDomains` must be greater than 0, when specified.
91
+
- When the number of eligible domains with match topology keys is less than `minDomains`,
92
+
Pod topology spread treats "global minimum" as 0, and then the calculation of `skew` is performed.
93
+
The "global minimum" is the minimum number of matching Pods in an eligible domain,
94
+
or zero if the number of eligible domains is less than `minDomains`.
95
+
- When the number of eligible domains with matching topology keys equals or is greater than
96
+
`minDomains`, this value has no effect on scheduling.
97
+
- When `minDomains` is nil, the constraint behaves as if `minDomains` is 1.
98
+
- When `minDomains` is not nil, the value of `whenUnsatisfiable` must be "`DoNotSchedule`".
99
+
100
+
{{< note >}}
101
+
The `minDomains` field is an alpha field added in 1.24. You have to enable the
- **topologyKey** is the key of node labels. If two Nodes are labelled with this key and have identical values for that label, the scheduler treats both Nodes as being in the same topology. The scheduler tries to place a balanced number of Pods into each topology domain.
107
+
83
108
- **whenUnsatisfiable** indicates how to deal with a Pod if it doesn't satisfy the spread constraint:
84
109
- `DoNotSchedule`(default) tells the scheduler not to schedule it.
85
110
- `ScheduleAnyway`tells the scheduler to still schedule it while prioritizing nodes that minimize the skew.
111
+
86
112
- **labelSelector** is used to find matching Pods. Pods that match this label selector are counted to determine the number of Pods in their corresponding topology domain. See [Label Selectors](/docs/concepts/overview/working-with-objects/labels/#label-selectors) for more details.
87
113
88
114
When a Pod defines more than one `topologySpreadConstraint`, those constraints are ANDed: The kube-scheduler looks for a node for the incoming Pod that satisfies all the constraints.
0 commit comments