AvoidPriority using ControllerRef

This commit is contained in:
Wojciech Tyczynski
2016-07-15 15:28:59 +02:00
parent 96284dac3b
commit c8c938c3e0
4 changed files with 87 additions and 87 deletions

View File

@@ -178,17 +178,9 @@ func defaultPriorities() sets.String {
Weight: 1,
},
),
factory.RegisterPriorityConfigFactory(
"NodePreferAvoidPodsPriority",
factory.PriorityConfigFactory{
Function: func(args factory.PluginFactoryArgs) algorithm.PriorityFunction {
return priorities.NewNodePreferAvoidPodsPriority(args.ControllerLister, args.ReplicaSetLister)
},
// Set this weight large enough to override all other priority functions.
// TODO: Figure out a better way to do this, maybe at same time as fixing #24720.
Weight: 10000,
},
),
// Set this weight large enough to override all other priority functions.
// TODO: Figure out a better way to do this, maybe at same time as fixing #24720.
factory.RegisterPriorityFunction("NodePreferAvoidPodsPriority", priorities.CalculateNodePreferAvoidPodsPriority, 10000),
factory.RegisterPriorityFunction("NodeAffinityPriority", priorities.CalculateNodeAffinityPriority, 1),
factory.RegisterPriorityFunction("TaintTolerationPriority", priorities.ComputeTaintTolerationPriority, 1),
// pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.)