Add pvc as part of equivalence hash

Use factory to generat get equivalence pod func
This commit is contained in:
Harry Zhang
2017-11-29 21:18:10 +08:00
parent af243f4824
commit e4055c0df2
8 changed files with 371 additions and 95 deletions

View File

@@ -80,8 +80,12 @@ func init() {
// Fit is determined by node selector query.
factory.RegisterFitPredicate("MatchNodeSelector", predicates.PodMatchNodeSelector)
// Use equivalence class to speed up predicates & priorities
factory.RegisterGetEquivalencePodFunction(predicates.GetEquivalencePod)
// Use equivalence class to speed up heavy predicates phase.
factory.RegisterGetEquivalencePodFunction(
func(args factory.PluginFactoryArgs) algorithm.GetEquivalencePodFunc {
return predicates.NewEquivalencePodGenerator(args.PVCInfo)
},
)
// ServiceSpreadingPriority is a priority config factory that spreads pods by minimizing
// the number of pods (belonging to the same service) on the same node.