Extent the NodeResourcesBalancedAllocation plugin to cover more resources

Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
Dave Chen
2021-05-12 18:47:59 +08:00
parent 7ad7c0757a
commit 1fa673c15c
27 changed files with 814 additions and 74 deletions

View File

@@ -30,9 +30,6 @@ type resourceToWeightMap map[v1.ResourceName]int64
// scorer is decorator for resourceAllocationScorer
type scorer func(args *config.NodeResourcesFitArgs) *resourceAllocationScorer
// defaultRequestedRatioResources is used to set default requestToWeight map for CPU and memory
var defaultRequestedRatioResources = resourceToWeightMap{v1.ResourceMemory: 1, v1.ResourceCPU: 1}
// resourceAllocationScorer contains information to calculate resource allocation score.
type resourceAllocationScorer struct {
Name string
@@ -42,7 +39,7 @@ type resourceAllocationScorer struct {
enablePodOverhead bool
}
// resourceToValueMap contains resource name and score.
// resourceToValueMap is keyed with resource name and valued with quantity.
type resourceToValueMap map[v1.ResourceName]int64
// score will use `scorer` function to calculate the score.