@@ -19,14 +19,15 @@ Each stage is exposed in a extension point. Plugins provide scheduling behaviors
19
19
by implementing one or more of these extension points.
20
20
21
21
You can specify scheduling profiles by running ` kube-scheduler --config <filename> ` ,
22
- using the
23
- [ KubeSchedulerConfiguration (v1beta1)] ( /docs/reference/config-api/kube-scheduler-config.v1beta1/ )
22
+ using the
23
+ KubeSchedulerConfiguration ([ v1beta1] ( /docs/reference/config-api/kube-scheduler-config.v1beta1/ )
24
+ or [ v1beta2] ( /docs/reference/config-api/kube-scheduler-config.v1beta2/ ) ).
24
25
struct.
25
26
26
27
A minimal configuration looks as follows:
27
28
28
29
``` yaml
29
- apiVersion : kubescheduler.config.k8s.io/v1beta1
30
+ apiVersion : kubescheduler.config.k8s.io/v1beta2
30
31
kind : KubeSchedulerConfiguration
31
32
clientConnection :
32
33
kubeconfig : /etc/srv/kubernetes/kube-scheduler/kubeconfig
@@ -48,38 +49,41 @@ You can configure a single instance of `kube-scheduler` to run
48
49
Scheduling happens in a series of stages that are exposed through the following
49
50
extension points :
50
51
51
- 1. `QueueSort ` : These plugins provide an ordering function that is used to
52
+ 1. `queueSort ` : These plugins provide an ordering function that is used to
52
53
sort pending Pods in the scheduling queue. Exactly one queue sort plugin
53
54
may be enabled at a time.
54
- 1. `PreFilter ` : These plugins are used to pre-process or check information
55
+ 1. `preFilter ` : These plugins are used to pre-process or check information
55
56
about a Pod or the cluster before filtering. They can mark a pod as
56
57
unschedulable.
57
- 1. `Filter ` : These plugins are the equivalent of Predicates in a scheduling
58
+ 1. `filter ` : These plugins are the equivalent of Predicates in a scheduling
58
59
Policy and are used to filter out nodes that can not run the Pod. Filters
59
60
are called in the configured order. A pod is marked as unschedulable if no
60
61
nodes pass all the filters.
61
- 1. `PreScore` : This is an informational extension point that can be used
62
+ 1. `postFilter` : These plugins are called in their configured order when no
63
+ feasible nodes were found for the pod. If any `postFilter` plugin marks the
64
+ Pod _schedulable_, the remaining plugins are not called.
65
+ 1. `preScore` : This is an informational extension point that can be used
62
66
for doing pre-scoring work.
63
- 1. `Score ` : These plugins provide a score to each node that has passed the
67
+ 1. `score ` : These plugins provide a score to each node that has passed the
64
68
filtering phase. The scheduler will then select the node with the highest
65
69
weighted scores sum.
66
- 1. `Reserve ` : This is an informational extension point that notifies plugins
70
+ 1. `reserve ` : This is an informational extension point that notifies plugins
67
71
when resources have been reserved for a given Pod. Plugins also implement an
68
72
` Unreserve` call that gets called in the case of failure during or after
69
73
` Reserve` .
70
- 1. `Permit ` : These plugins can prevent or delay the binding of a Pod.
71
- 1. `PreBind ` : These plugins perform any work required before a Pod is bound.
72
- 1. `Bind ` : The plugins bind a Pod to a Node. Bind plugins are called in order
74
+ 1. `permit ` : These plugins can prevent or delay the binding of a Pod.
75
+ 1. `preBind ` : These plugins perform any work required before a Pod is bound.
76
+ 1. `bind ` : The plugins bind a Pod to a Node. `bind` plugins are called in order
73
77
and once one has done the binding, the remaining plugins are skipped. At
74
78
least one bind plugin is required.
75
- 1. `PostBind ` : This is an informational extension point that is called after
79
+ 1. `postBind ` : This is an informational extension point that is called after
76
80
a Pod has been bound.
77
81
78
82
For each extension point, you could disable specific [default plugins](#scheduling-plugins)
79
83
or enable your own. For example :
80
84
81
85
` ` ` yaml
82
- apiVersion: kubescheduler.config.k8s.io/v1beta1
86
+ apiVersion: kubescheduler.config.k8s.io/v1beta2
83
87
kind: KubeSchedulerConfiguration
84
88
profiles:
85
89
- plugins:
@@ -99,106 +103,109 @@ desired.
99
103
100
104
# ## Scheduling plugins
101
105
102
- 1. `UnReserve` : This is an informational extension point that is called if
103
- a Pod is rejected after being reserved and put on hold by a `Permit` plugin.
104
-
105
- # # Scheduling plugins
106
-
107
106
The following plugins, enabled by default, implement one or more of these
108
107
extension points :
109
108
110
- - `SelectorSpread` : Favors spreading across nodes for Pods that belong to
111
- {{< glossary_tooltip text="Services" term_id="service" >}},
112
- {{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} and
113
- {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}}.
114
- Extension points : ` PreScore` , `Score`.
115
109
- `ImageLocality` : Favors nodes that already have the container images that the
116
110
Pod runs.
117
- Extension points : ` Score ` .
111
+ Extension points : ` score ` .
118
112
- `TaintToleration` : Implements
119
113
[taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/).
120
- Implements extension points : ` Filter ` , `Prescore `, `Score `.
114
+ Implements extension points : ` filter ` , `preScore `, `score `.
121
115
- `NodeName` : Checks if a Pod spec node name matches the current node.
122
- Extension points : ` Filter ` .
116
+ Extension points : ` filter ` .
123
117
- `NodePorts` : Checks if a node has free ports for the requested Pod ports.
124
- Extension points : ` PreFilter ` , `Filter `.
118
+ Extension points : ` preFilter ` , `filter `.
125
119
- `NodePreferAvoidPods` : Scores nodes according to the node
126
120
{{< glossary_tooltip text="annotation" term_id="annotation" >}}
127
121
` scheduler.alpha.kubernetes.io/preferAvoidPods` .
128
- Extension points : ` Score ` .
122
+ Extension points : ` score ` .
129
123
- `NodeAffinity` : Implements
130
124
[node selectors](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
131
125
and [node affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity).
132
- Extension points : ` Filter ` , `Score `.
126
+ Extension points : ` filter ` , `score `.
133
127
- `PodTopologySpread` : Implements
134
128
[Pod topology spread](/docs/concepts/workloads/pods/pod-topology-spread-constraints/).
135
- Extension points : ` PreFilter ` , `Filter `, `PreScore `, `Score `.
129
+ Extension points : ` preFilter ` , `filter `, `preScore `, `score `.
136
130
- `NodeUnschedulable` : Filters out nodes that have `.spec.unschedulable` set to
137
131
true.
138
- Extension points : ` Filter ` .
132
+ Extension points : ` filter ` .
139
133
- `NodeResourcesFit` : Checks if the node has all the resources that the Pod is
140
- requesting.
141
- Extension points : ` PreFilter` , `Filter`.
134
+ requesting. The score can use one of three strategies : ` LeastAllocated`
135
+ (default), `MostAllocated` and `RequestedToCapacityRatio`.
136
+ Extension points : ` preFilter` , `filter`, `score`.
142
137
- `NodeResourcesBalancedAllocation` : Favors nodes that would obtain a more
143
138
balanced resource usage if the Pod is scheduled there.
144
- Extension points : ` Score` .
145
- - `NodeResourcesLeastAllocated` : Favors nodes that have a low allocation of
146
- resources.
147
- Extension points : ` Score` .
139
+ Extension points : ` score` .
148
140
- `VolumeBinding` : Checks if the node has or if it can bind the requested
149
141
{{< glossary_tooltip text="volumes" term_id="volume" >}}.
150
- Extension points : ` PreFilter ` , `Filter `, `Reserve `, `PreBind `, `Score `.
142
+ Extension points : ` preFilter ` , `filter `, `reserve `, `preBind `, `score `.
151
143
{{< note >}}
152
- ` Score ` extension point is enabled when `VolumeCapacityPriority` feature is
144
+ ` score ` extension point is enabled when `VolumeCapacityPriority` feature is
153
145
enabled. It prioritizes the smallest PVs that can fit the requested volume
154
146
size.
155
147
{{< /note >}}
156
148
- `VolumeRestrictions` : Checks that volumes mounted in the node satisfy
157
149
restrictions that are specific to the volume provider.
158
- Extension points : ` Filter ` .
150
+ Extension points : ` filter ` .
159
151
- `VolumeZone` : Checks that volumes requested satisfy any zone requirements they
160
152
might have.
161
- Extension points : ` Filter ` .
153
+ Extension points : ` filter ` .
162
154
- `NodeVolumeLimits` : Checks that CSI volume limits can be satisfied for the
163
155
node.
164
- Extension points : ` Filter ` .
156
+ Extension points : ` filter ` .
165
157
- `EBSLimits` : Checks that AWS EBS volume limits can be satisfied for the node.
166
- Extension points : ` Filter ` .
158
+ Extension points : ` filter ` .
167
159
- `GCEPDLimits` : Checks that GCP-PD volume limits can be satisfied for the node.
168
- Extension points : ` Filter ` .
160
+ Extension points : ` filter ` .
169
161
- `AzureDiskLimits` : Checks that Azure disk volume limits can be satisfied for
170
162
the node.
171
- Extension points : ` Filter ` .
163
+ Extension points : ` filter ` .
172
164
- `InterPodAffinity` : Implements
173
165
[inter-Pod affinity and anti-affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity).
174
- Extension points : ` PreFilter ` , `Filter `, `PreScore `, `Score `.
166
+ Extension points : ` preFilter ` , `filter `, `preScore `, `score `.
175
167
- `PrioritySort` : Provides the default priority based sorting.
176
- Extension points : ` QueueSort ` .
168
+ Extension points : ` queueSort ` .
177
169
- `DefaultBinder` : Provides the default binding mechanism.
178
- Extension points : ` Bind ` .
170
+ Extension points : ` bind ` .
179
171
- `DefaultPreemption` : Provides the default preemption mechanism.
180
- Extension points : ` PostFilter ` .
172
+ Extension points : ` postFilter ` .
181
173
182
174
You can also enable the following plugins, through the component config APIs,
183
175
that are not enabled by default :
184
176
177
+ - `SelectorSpread` : Favors spreading across nodes for Pods that belong to
178
+ {{< glossary_tooltip text="Services" term_id="service" >}},
179
+ {{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} and
180
+ {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}}.
181
+ Extension points : ` preScore` , `score`.
182
+ - `CinderLimits` : Checks that [OpenStack Cinder](https://docs.openstack.org/cinder/)
183
+ volume limits can be satisfied for the node.
184
+ Extension points : ` filter` .
185
+
186
+ The following plugins are deprecated and can only be enabled in a `v1beta1`
187
+ configuration :
188
+
189
+ - `NodeResourcesLeastAllocated` : Favors nodes that have a low allocation of
190
+ resources.
191
+ Extension points : ` score` .
185
192
- `NodeResourcesMostAllocated` : Favors nodes that have a high allocation of
186
193
resources.
187
- Extension points : ` Score ` .
194
+ Extension points : ` score ` .
188
195
- `RequestedToCapacityRatio` : Favor nodes according to a configured function of
189
196
the allocated resources.
190
- Extension points : ` Score` .
191
- - `CinderVolume` : Checks that OpenStack Cinder volume limits can be satisfied
192
- for the node.
193
- Extension points : ` Filter` .
197
+ Extension points : ` score` .
194
198
- `NodeLabel` : Filters and / or scores a node according to configured
195
199
{{< glossary_tooltip text="label(s)" term_id="label" >}}.
196
- Extension points : ` Filter ` , `Score `.
200
+ Extension points : ` filter ` , `score `.
197
201
- `ServiceAffinity` : Checks that Pods that belong to a
198
202
{{< glossary_tooltip term_id="service" >}} fit in a set of nodes defined by
199
203
configured labels. This plugin also favors spreading the Pods belonging to a
200
204
Service across nodes.
201
- Extension points : ` PreFilter` , `Filter`, `Score`.
205
+ Extension points : ` preFilter` , `filter`, `score`.
206
+ - `NodePreferAvoidPods` : Prioritizes nodes according to the node annotation
207
+ ` scheduler.alpha.kubernetes.io/preferAvoidPods` .
208
+ Extension points : ` score` .
202
209
203
210
# ## Multiple profiles
204
211
@@ -211,7 +218,7 @@ profiles: one with the default plugins and one with all scoring plugins
211
218
disabled.
212
219
213
220
` ` ` yaml
214
- apiVersion: kubescheduler.config.k8s.io/v1beta1
221
+ apiVersion: kubescheduler.config.k8s.io/v1beta2
215
222
kind: KubeSchedulerConfiguration
216
223
profiles:
217
224
- schedulerName: default-scheduler
@@ -243,7 +250,7 @@ list.
243
250
{{< /note >}}
244
251
245
252
{{< note >}}
246
- All profiles must use the same plugin in the QueueSort extension point and have
253
+ All profiles must use the same plugin in the `queueSort` extension point and have
247
254
the same configuration parameters (if applicable). This is because the scheduler
248
255
only has one pending pods queue.
249
256
{{< /note >}}
@@ -252,5 +259,6 @@ only has one pending pods queue.
252
259
253
260
* Read the [kube-scheduler reference](/docs/reference/command-line-tools-reference/kube-scheduler/)
254
261
* Learn about [scheduling](/docs/concepts/scheduling-eviction/kube-scheduler/)
262
+ * Read the [kube-scheduler configuration (v1beta2)](/docs/reference/config-api/kube-scheduler-config.v1beta2/) reference
255
263
* Read the [kube-scheduler configuration (v1beta1)](/docs/reference/config-api/kube-scheduler-config.v1beta1/) reference
256
264
0 commit comments