Skip to content

Commit 3ff838a

Browse files
PBundyramimowo
authored andcommitted
Add BestFit algorithm to TAS (kubernetes-sigs#4228)
* Add info about BestFit algorithm to KEP * Implement BestFit algorithm * Use built-in sort.Search function, add optimizations at every level * Improve bestFit function, add test scenario * Change BestFit into LargestFit, fix a test scenario * Fix checker, correct featureGate name * Adjust new feature gate * Fix tests with changed feature gate * Cleaned up logic * Adjusted test results for the BestFit default algorithm * Change naming LargestFit -> LeastAllocated, BestFit -> MostAllocated * Pick the first MostAllocated domain that can accommodate all pods * Fix linter, improve naming * Simplify logic * Simplify logic, adjust comments * Mark some test scenarios to drop after removing the feature gate * Add TODOs comments, mention dropping the feature gate in GA in KEP * Improve logic, add test * Improve logic * Update keps/2724-topology-aware-scheduling/README.md Co-authored-by: Michał Woźniak <[email protected]> * Address nits * Address nits * Rename feature gate --------- Co-authored-by: Michał Woźniak <[email protected]>
1 parent 1088d67 commit 3ff838a

File tree

5 files changed

+370
-61
lines changed

5 files changed

+370
-61
lines changed

keps/2724-topology-aware-scheduling/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,12 @@ For a given PodSet Kueue:
648648
level. Kueue starts the search from the specified level, but if the PodSet
649649
does not fit, then it tries higher levels in the hierarchy.
650650

651+
Kueue packs pods on domains starting from the domains with the most free capacity. However, Kueue can operate in two modes when it comes to choosing the last domain if there is more than one capable of accommodating the remaining pods:
652+
- `MostAllocated` - Kueue chooses the domain with the least available resource that is capable of accommodating all the pods to mitigate resource fragmentation
653+
- `LeastAllocated` - Kueue chooses the domain that has the most available resources, providing better nodes utilization
654+
655+
By default Kueue uses the `MostAllocated` algorithm. To use `LeastAllocated` algorithm, a user needs to set the feature gate `TASLeastAllocated` to `true`
656+
651657
### Enforcing the assignment
652658

653659
When the workload has the PodSet assignments and is about to start we modify the
@@ -753,6 +759,7 @@ Consider the following improvements and implement if feasible:
753759
is running
754760
- perform full scheduling simulation rather than just capacity counting
755761
(including pod affinities and anti-affinities)
762+
- drop `TASLeastAllocated` feature gate
756763

757764
## Implementation History
758765

keps/2724-topology-aware-scheduling/kep.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ milestone:
3131
# List the feature gate name and the components for which it must be enabled
3232
feature-gates:
3333
- name: TopologyAwareScheduling
34+
- name: TASLeastAllocated
3435
disable-supported: true
3536

3637
# The following PRR answers are required at beta release

0 commit comments

Comments
 (0)