implement taints and tolerations

This commit is contained in:
Kevin
2016-03-31 11:42:57 +08:00
parent 952e8302fb
commit 52fb89ff73
34 changed files with 4623 additions and 69 deletions

View File

@@ -145,6 +145,14 @@ func defaultPredicates() sets.String {
// GeneralPredicates are the predicates that are enforced by all Kubernetes components
// (e.g. kubelet and all schedulers)
factory.RegisterFitPredicate("GeneralPredicates", predicates.GeneralPredicates),
// Fit is determined based on whether a pod can tolerate all of the node's taints
factory.RegisterFitPredicateFactory(
"PodToleratesNodeTaints",
func(args factory.PluginFactoryArgs) algorithm.FitPredicate {
return predicates.NewTolerationMatchPredicate(args.NodeInfo)
},
),
)
}
@@ -173,5 +181,14 @@ func defaultPriorities() sets.String {
Weight: 1,
},
),
factory.RegisterPriorityConfigFactory(
"TaintTolerationPriority",
factory.PriorityConfigFactory{
Function: func(args factory.PluginFactoryArgs) algorithm.PriorityFunction {
return priorities.NewTaintTolerationPriority(args.NodeLister)
},
Weight: 1,
},
),
)
}