Skip to content

Commit a1fd3a2

Browse files
authored
Merge pull request #28839 from alculquicondor/scheduler_config
Update plugin names and deprecations for scheduler config
2 parents 11a343a + a5c3c66 commit a1fd3a2

File tree

2 files changed

+75
-59
lines changed

2 files changed

+75
-59
lines changed

content/en/docs/reference/labels-annotations-taints.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ Used on: Endpoints
268268

269269
In Kubernetes clusters v1.21 (or later), the Endpoints controller adds this annotation to an Endpoints resource if it has more than 1000 endpoints. The annotation indicates that the Endpoints resource is over capacity.
270270

271+
## scheduler.alpha.kubernetes.io/preferAvoidPods (deprecated) {#scheduleralphakubernetesio-preferavoidpods}
272+
273+
Used on: Nodes
274+
275+
This annotation requires the [NodePreferAvoidPods scheduling plugin](/docs/reference/scheduling/config/#scheduling-plugins)
276+
to be enabled. The plugin is deprecated since Kubernetes 1.22.
277+
Use [Taints and Tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/) instead.
278+
271279
**The taints listed below are always used on Nodes**
272280

273281
## node.kubernetes.io/not-ready

content/en/docs/reference/scheduling/config.md

Lines changed: 67 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ Each stage is exposed in a extension point. Plugins provide scheduling behaviors
1919
by implementing one or more of these extension points.
2020

2121
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/)).
2425
struct.
2526

2627
A minimal configuration looks as follows:
2728

2829
```yaml
29-
apiVersion: kubescheduler.config.k8s.io/v1beta1
30+
apiVersion: kubescheduler.config.k8s.io/v1beta2
3031
kind: KubeSchedulerConfiguration
3132
clientConnection:
3233
kubeconfig: /etc/srv/kubernetes/kube-scheduler/kubeconfig
@@ -48,38 +49,41 @@ You can configure a single instance of `kube-scheduler` to run
4849
Scheduling happens in a series of stages that are exposed through the following
4950
extension points:
5051

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
5253
sort pending Pods in the scheduling queue. Exactly one queue sort plugin
5354
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
5556
about a Pod or the cluster before filtering. They can mark a pod as
5657
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
5859
Policy and are used to filter out nodes that can not run the Pod. Filters
5960
are called in the configured order. A pod is marked as unschedulable if no
6061
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
6266
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
6468
filtering phase. The scheduler will then select the node with the highest
6569
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
6771
when resources have been reserved for a given Pod. Plugins also implement an
6872
`Unreserve` call that gets called in the case of failure during or after
6973
`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
7377
and once one has done the binding, the remaining plugins are skipped. At
7478
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
7680
a Pod has been bound.
7781

7882
For each extension point, you could disable specific [default plugins](#scheduling-plugins)
7983
or enable your own. For example:
8084

8185
```yaml
82-
apiVersion: kubescheduler.config.k8s.io/v1beta1
86+
apiVersion: kubescheduler.config.k8s.io/v1beta2
8387
kind: KubeSchedulerConfiguration
8488
profiles:
8589
- plugins:
@@ -99,106 +103,109 @@ desired.
99103

100104
### Scheduling plugins
101105

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-
107106
The following plugins, enabled by default, implement one or more of these
108107
extension points:
109108

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`.
115109
- `ImageLocality`: Favors nodes that already have the container images that the
116110
Pod runs.
117-
Extension points: `Score`.
111+
Extension points: `score`.
118112
- `TaintToleration`: Implements
119113
[taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/).
120-
Implements extension points: `Filter`, `Prescore`, `Score`.
114+
Implements extension points: `filter`, `preScore`, `score`.
121115
- `NodeName`: Checks if a Pod spec node name matches the current node.
122-
Extension points: `Filter`.
116+
Extension points: `filter`.
123117
- `NodePorts`: Checks if a node has free ports for the requested Pod ports.
124-
Extension points: `PreFilter`, `Filter`.
118+
Extension points: `preFilter`, `filter`.
125119
- `NodePreferAvoidPods`: Scores nodes according to the node
126120
{{< glossary_tooltip text="annotation" term_id="annotation" >}}
127121
`scheduler.alpha.kubernetes.io/preferAvoidPods`.
128-
Extension points: `Score`.
122+
Extension points: `score`.
129123
- `NodeAffinity`: Implements
130124
[node selectors](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
131125
and [node affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity).
132-
Extension points: `Filter`, `Score`.
126+
Extension points: `filter`, `score`.
133127
- `PodTopologySpread`: Implements
134128
[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`.
136130
- `NodeUnschedulable`: Filters out nodes that have `.spec.unschedulable` set to
137131
true.
138-
Extension points: `Filter`.
132+
Extension points: `filter`.
139133
- `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`.
142137
- `NodeResourcesBalancedAllocation`: Favors nodes that would obtain a more
143138
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`.
148140
- `VolumeBinding`: Checks if the node has or if it can bind the requested
149141
{{< glossary_tooltip text="volumes" term_id="volume" >}}.
150-
Extension points: `PreFilter`, `Filter`, `Reserve`, `PreBind`, `Score`.
142+
Extension points: `preFilter`, `filter`, `reserve`, `preBind`, `score`.
151143
{{< note >}}
152-
`Score` extension point is enabled when `VolumeCapacityPriority` feature is
144+
`score` extension point is enabled when `VolumeCapacityPriority` feature is
153145
enabled. It prioritizes the smallest PVs that can fit the requested volume
154146
size.
155147
{{< /note >}}
156148
- `VolumeRestrictions`: Checks that volumes mounted in the node satisfy
157149
restrictions that are specific to the volume provider.
158-
Extension points: `Filter`.
150+
Extension points: `filter`.
159151
- `VolumeZone`: Checks that volumes requested satisfy any zone requirements they
160152
might have.
161-
Extension points: `Filter`.
153+
Extension points: `filter`.
162154
- `NodeVolumeLimits`: Checks that CSI volume limits can be satisfied for the
163155
node.
164-
Extension points: `Filter`.
156+
Extension points: `filter`.
165157
- `EBSLimits`: Checks that AWS EBS volume limits can be satisfied for the node.
166-
Extension points: `Filter`.
158+
Extension points: `filter`.
167159
- `GCEPDLimits`: Checks that GCP-PD volume limits can be satisfied for the node.
168-
Extension points: `Filter`.
160+
Extension points: `filter`.
169161
- `AzureDiskLimits`: Checks that Azure disk volume limits can be satisfied for
170162
the node.
171-
Extension points: `Filter`.
163+
Extension points: `filter`.
172164
- `InterPodAffinity`: Implements
173165
[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`.
175167
- `PrioritySort`: Provides the default priority based sorting.
176-
Extension points: `QueueSort`.
168+
Extension points: `queueSort`.
177169
- `DefaultBinder`: Provides the default binding mechanism.
178-
Extension points: `Bind`.
170+
Extension points: `bind`.
179171
- `DefaultPreemption`: Provides the default preemption mechanism.
180-
Extension points: `PostFilter`.
172+
Extension points: `postFilter`.
181173

182174
You can also enable the following plugins, through the component config APIs,
183175
that are not enabled by default:
184176

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`.
185192
- `NodeResourcesMostAllocated`: Favors nodes that have a high allocation of
186193
resources.
187-
Extension points: `Score`.
194+
Extension points: `score`.
188195
- `RequestedToCapacityRatio`: Favor nodes according to a configured function of
189196
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`.
194198
- `NodeLabel`: Filters and / or scores a node according to configured
195199
{{< glossary_tooltip text="label(s)" term_id="label" >}}.
196-
Extension points: `Filter`, `Score`.
200+
Extension points: `filter`, `score`.
197201
- `ServiceAffinity`: Checks that Pods that belong to a
198202
{{< glossary_tooltip term_id="service" >}} fit in a set of nodes defined by
199203
configured labels. This plugin also favors spreading the Pods belonging to a
200204
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`.
202209

203210
### Multiple profiles
204211

@@ -211,7 +218,7 @@ profiles: one with the default plugins and one with all scoring plugins
211218
disabled.
212219

213220
```yaml
214-
apiVersion: kubescheduler.config.k8s.io/v1beta1
221+
apiVersion: kubescheduler.config.k8s.io/v1beta2
215222
kind: KubeSchedulerConfiguration
216223
profiles:
217224
- schedulerName: default-scheduler
@@ -243,7 +250,7 @@ list.
243250
{{< /note >}}
244251

245252
{{< 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
247254
the same configuration parameters (if applicable). This is because the scheduler
248255
only has one pending pods queue.
249256
{{< /note >}}
@@ -252,5 +259,6 @@ only has one pending pods queue.
252259

253260
* Read the [kube-scheduler reference](/docs/reference/command-line-tools-reference/kube-scheduler/)
254261
* 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
255263
* Read the [kube-scheduler configuration (v1beta1)](/docs/reference/config-api/kube-scheduler-config.v1beta1/) reference
256264

0 commit comments

Comments
 (0)