Skip to content

Commit 7599e38

Browse files
authored
Merge pull request kubernetes#3245 from sanposhiho/patch-2
Update KEP-3022 based on the latest implementation
2 parents 0ca8a5c + 2d0dc7d commit 7599e38

File tree

1 file changed

+29
-10
lines changed
  • keps/sig-scheduling/3022-min-domains-in-pod-topology-spread

1 file changed

+29
-10
lines changed

keps/sig-scheduling/3022-min-domains-in-pod-topology-spread/README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ is equal to the minimum number of matching pods on a domain.
9999

100100
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`.
101101

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.
103103

104104
### API
105105

@@ -108,12 +108,31 @@ New optional parameter called `MinDomains` is introduced to `PodSpec.TopologySpr
108108
```go
109109
type TopologySpreadConstraint struct {
110110
......
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
117136
MinDomains *int32
118137
}
119138
```
@@ -192,9 +211,9 @@ To ensure this feature to be rolled out in high quality. Following tests are man
192211

193212
#### Alpha (v1.24):
194213

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).
198217

199218
#### Beta (v1.25):
200219

0 commit comments

Comments
 (0)