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: keps/sig-scheduling/3022-min-domains-in-pod-topology-spread/README.md
+29-10Lines changed: 29 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ is equal to the minimum number of matching pods on a domain.
99
99
100
100
As a result, when the number of domains is less than `minDomains`, scheduler doesn't schedule a matching Pod to Nodes on the domains that have the same or more number of matching Pods as `maxSkew`.
101
101
102
-
`minDomains` is an optional parameter and the default value is 0.
102
+
`minDomains` is an optional parameter. If `minDomains` is nil, the constraint behaves as if MinDomains is equal to 1.
103
103
104
104
### API
105
105
@@ -108,12 +108,31 @@ New optional parameter called `MinDomains` is introduced to `PodSpec.TopologySpr
108
108
```go
109
109
typeTopologySpreadConstraintstruct {
110
110
......
111
-
// When the number of domains with matching topology keys is less than `minDomains`,
112
-
// Pod Topology Spread treats "global minimum" as 0.
113
-
// As a result, when the number of domains is less than `minDomains`,
114
-
// scheduler doesn't schedule a matching Pod to Nodes on the domains that have the same or more number of matching Pods as `maxSkew`.
115
-
// Default value is 0. When value is different than 0, WhenUnsatisfiable must be DoNotSchedule.
116
-
// +optional
111
+
// MinDomains indicates a minimum number of eligible domains.
112
+
// When the number of eligible domains with matching topology keys is less than minDomains,
113
+
// Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
114
+
// And when the number of eligible domains with matching topology keys equals or greater than minDomains,
115
+
// this value has no effect on scheduling.
116
+
// As a result, when the number of eligible domains is less than minDomains,
117
+
// scheduler won't schedule more than maxSkew Pods to those domains.
118
+
// If value is nil, the constraint behaves as if MinDomains is equal to 1.
119
+
// Valid values are integers greater than 0.
120
+
// When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
121
+
//
122
+
// For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
123
+
// labelSelector spread as 2/2/2:
124
+
// +-------+-------+-------+
125
+
// | zone1 | zone2 | zone3 |
126
+
// +-------+-------+-------+
127
+
// | P P | P P | P P |
128
+
// +-------+-------+-------+
129
+
// The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
130
+
// In this situation, new pod with the same labelSelector cannot be scheduled,
131
+
// because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
132
+
// it will violate MaxSkew.
133
+
//
134
+
// This is an alpha field and requires enabling MinDomainsInPodTopologySpread feature gate.
135
+
// +optional
117
136
MinDomains *int32
118
137
}
119
138
```
@@ -192,9 +211,9 @@ To ensure this feature to be rolled out in high quality. Following tests are man
192
211
193
212
#### Alpha (v1.24):
194
213
195
-
- [] Add new parameter `MinDomains` to `TopologySpreadConstraint` and feature gating.
196
-
- [] Filter extension point implementation.
197
-
- [] Implement all tests mentioned in the [Test Plan](#test-plan).
214
+
- [x] Add new parameter `MinDomains` to `TopologySpreadConstraint` and feature gating.
215
+
- [x] Filter extension point implementation.
216
+
- [x] Implement all tests mentioned in the [Test Plan](#test-plan).
0 commit comments