@@ -18,7 +18,6 @@ package defaults
18
18
19
19
import (
20
20
"k8s.io/kubernetes/pkg/scheduler"
21
- "k8s.io/kubernetes/pkg/scheduler/algorithm"
22
21
"k8s.io/kubernetes/pkg/scheduler/algorithm/priorities"
23
22
)
24
23
@@ -32,62 +31,4 @@ func init() {
32
31
statefulSetLister := args .InformerFactory .Apps ().V1 ().StatefulSets ().Lister ()
33
32
return priorities .NewMetadataFactory (serviceLister , controllerLister , replicaSetLister , statefulSetLister , args .HardPodAffinitySymmetricWeight )
34
33
})
35
-
36
- // ServiceSpreadingPriority is a priority config factory that spreads pods by minimizing
37
- // the number of pods (belonging to the same service) on the same node.
38
- // Register the factory so that it's available, but do not include it as part of the default priorities
39
- // Largely replaced by "SelectorSpreadPriority", but registered for backward compatibility with 1.0
40
- scheduler .RegisterPriorityConfigFactory (
41
- priorities .ServiceSpreadingPriority ,
42
- scheduler.PriorityConfigFactory {
43
- MapReduceFunction : func (args scheduler.AlgorithmFactoryArgs ) (priorities.PriorityMapFunction , priorities.PriorityReduceFunction ) {
44
- serviceLister := args .InformerFactory .Core ().V1 ().Services ().Lister ()
45
- return priorities .NewSelectorSpreadPriority (serviceLister , algorithm.EmptyControllerLister {}, algorithm.EmptyReplicaSetLister {}, algorithm.EmptyStatefulSetLister {})
46
- },
47
- Weight : 1 ,
48
- },
49
- )
50
- // Optional, cluster-autoscaler friendly priority function - give used nodes higher priority.
51
- scheduler .RegisterPriorityMapReduceFunction (priorities .MostRequestedPriority , priorities .MostRequestedPriorityMap , nil , 1 )
52
- scheduler .RegisterPriorityMapReduceFunction (
53
- priorities .RequestedToCapacityRatioPriority ,
54
- priorities .RequestedToCapacityRatioResourceAllocationPriorityDefault ().PriorityMap ,
55
- nil ,
56
- 1 )
57
- // spreads pods by minimizing the number of pods (belonging to the same service or replication controller) on the same node.
58
- scheduler .RegisterPriorityConfigFactory (
59
- priorities .SelectorSpreadPriority ,
60
- scheduler.PriorityConfigFactory {
61
- MapReduceFunction : func (args scheduler.AlgorithmFactoryArgs ) (priorities.PriorityMapFunction , priorities.PriorityReduceFunction ) {
62
- serviceLister := args .InformerFactory .Core ().V1 ().Services ().Lister ()
63
- controllerLister := args .InformerFactory .Core ().V1 ().ReplicationControllers ().Lister ()
64
- replicaSetLister := args .InformerFactory .Apps ().V1 ().ReplicaSets ().Lister ()
65
- statefulSetLister := args .InformerFactory .Apps ().V1 ().StatefulSets ().Lister ()
66
- return priorities .NewSelectorSpreadPriority (serviceLister , controllerLister , replicaSetLister , statefulSetLister )
67
- },
68
- Weight : 1 ,
69
- },
70
- )
71
- // pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.)
72
- // as some other pods, or, conversely, should not be placed in the same topological domain as some other pods.
73
- scheduler .RegisterPriorityMapReduceFunction (priorities .InterPodAffinityPriority , nil , nil , 1 )
74
-
75
- // Prioritize nodes by least requested utilization.
76
- scheduler .RegisterPriorityMapReduceFunction (priorities .LeastRequestedPriority , priorities .LeastRequestedPriorityMap , nil , 1 )
77
-
78
- // Prioritizes nodes to help achieve balanced resource usage
79
- scheduler .RegisterPriorityMapReduceFunction (priorities .BalancedResourceAllocation , priorities .BalancedResourceAllocationMap , nil , 1 )
80
-
81
- // Set this weight large enough to override all other priority functions.
82
- // TODO: Figure out a better way to do this, maybe at same time as fixing #24720.
83
- scheduler .RegisterPriorityMapReduceFunction (priorities .NodePreferAvoidPodsPriority , nil , nil , 10000 )
84
-
85
- // Prioritizes nodes that have labels matching NodeAffinity
86
- scheduler .RegisterPriorityMapReduceFunction (priorities .NodeAffinityPriority , nil , nil , 1 )
87
-
88
- // Prioritizes nodes that marked with taint which pod can tolerate.
89
- scheduler .RegisterPriorityMapReduceFunction (priorities .TaintTolerationPriority , nil , nil , 1 )
90
-
91
- // ImageLocalityPriority prioritizes nodes that have images requested by the pod present.
92
- scheduler .RegisterPriorityMapReduceFunction (priorities .ImageLocalityPriority , nil , nil , 1 )
93
34
}
0 commit comments