@@ -3,16 +3,16 @@ title: 调度器配置
3
3
content_type : concept
4
4
weight : 20
5
5
---
6
- <!--
6
+ <!--
7
7
title: Scheduler Configuration
8
8
content_type: concept
9
9
weight: 20
10
10
-->
11
11
{{< feature-state for_k8s_version="v1.19" state="beta" >}}
12
12
13
- <!--
13
+ <!--
14
14
You can customize the behavior of the `kube-scheduler` by writing a configuration
15
- file and passing its path as a command line argument.
15
+ file and passing its path as a command line argument.
16
16
-->
17
17
你可以通过编写配置文件,并将其路径传给 ` kube-scheduler ` 的命令行参数,定制 ` kube-scheduler ` 的行为。
18
18
@@ -82,14 +82,14 @@ extension points:
82
82
-->
83
83
1. `QueueSort`:这些插件对调度队列中的悬决的 Pod 排序。
84
84
一次只能启用一个队列排序插件。
85
- <!--
85
+ <!--
86
86
2. `PreFilter` : These plugins are used to pre-process or check information
87
87
about a Pod or the cluster before filtering. They can mark a pod as
88
88
unschedulable.
89
89
-->
90
90
2. `PreFilter`:这些插件用于在过滤之前预处理或检查 Pod 或集群的信息。
91
91
它们可以将 Pod 标记为不可调度。
92
- <!--
92
+ <!--
93
93
3. `Filter` : These plugins are the equivalent of Predicates in a scheduling
94
94
Policy and are used to filter out nodes that can not run the Pod. Filters
95
95
are called in the configured order. A pod is marked as unschedulable if no
@@ -98,7 +98,7 @@ extension points:
98
98
3. `Filter`:这些插件相当于调度策略中的断言(Predicates),用于过滤不能运行 Pod 的节点。
99
99
过滤器的调用顺序是可配置的。
100
100
如果没有一个节点通过所有过滤器的筛选,Pod 将会被标记为不可调度。
101
- <!--
101
+ <!--
102
102
4. `PreScore` : This is an informational extension point that can be used
103
103
for doing pre-scoring work.
104
104
-->
@@ -127,13 +127,13 @@ extension points:
127
127
least one bind plugin is required.
128
128
-->
129
129
9. `Bind`:这个插件将 Pod 与节点绑定。绑定插件是按顺序调用的,只要有一个插件完成了绑定,其余插件都会跳过。绑定插件至少需要一个。
130
- <!--
130
+ <!--
131
131
10. `PostBind` : This is an informational extension point that is called after
132
132
a Pod has been bound.
133
133
-->
134
134
10. `PostBind`:这是一个信息扩展点,在 Pod 绑定了节点之后调用。
135
135
136
- <!--
136
+ <!--
137
137
For each extension point, you could disable specific [default plugins](#scheduling-plugins)
138
138
or enable your own. For example :
139
139
-->
@@ -154,18 +154,18 @@ profiles:
154
154
weight: 1
155
155
` ` `
156
156
157
- <!--
157
+ <!--
158
158
You can use `*` as name in the disabled array to disable all default plugins
159
159
for that extension point. This can also be used to rearrange plugins order, if
160
160
desired.
161
161
-->
162
162
你可以在 `disabled` 数组中使用 `*` 禁用该扩展点的所有默认插件。
163
163
如果需要,这个字段也可以用来对插件重新顺序。
164
-
164
+
165
165
<!-- # ## Scheduling plugins -->
166
166
# ## 调度插件 {#scheduling-plugin}
167
167
168
- <!--
168
+ <!--
169
169
1. `UnReserve` : This is an informational extension point that is called if
170
170
a Pod is rejected after being reserved and put on hold by a `Permit` plugin.
171
171
-->
@@ -190,47 +190,47 @@ extension points:
190
190
- ` SelectorSpread` :对于属于 {{< glossary_tooltip text="Services" term_id="service" >}}、
191
191
{{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} 和
192
192
{{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} 的 Pod,偏好跨多个节点部署。
193
-
193
+
194
194
实现的扩展点:`PreScore`,`Score`。
195
195
<!--
196
196
- `ImageLocality` : Favors nodes that already have the container images that the
197
197
Pod runs.
198
198
Extension points : ` Score` .
199
199
-->
200
200
- ` ImageLocality` :选择已经存在 Pod 运行所需容器镜像的节点。
201
-
201
+
202
202
实现的扩展点:`Score`。
203
203
<!--
204
204
- `TaintToleration` : Implements
205
205
[taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/).
206
206
Implements extension points : ` Filter` , `Prescore`, `Score`.
207
207
-->
208
208
- ` TaintToleration` :实现了[污点和容忍](/zh/docs/concepts/scheduling-eviction/taint-and-toleration/)。
209
-
209
+
210
210
实现的扩展点:`Filter`,`Prescore`,`Score`。
211
211
<!--
212
212
- `NodeName` : Checks if a Pod spec node name matches the current node.
213
213
Extension points : ` Filter` .
214
214
-->
215
215
- ` NodeName` :检查 Pod 指定的节点名称与当前节点是否匹配。
216
-
216
+
217
217
实现的扩展点:`Filter`。
218
218
<!--
219
219
- `NodePorts` : Checks if a node has free ports for the requested Pod ports.
220
220
Extension points : ` PreFilter` , `Filter`.
221
221
-->
222
222
- ` NodePorts` :检查 Pod 请求的端口在节点上是否可用。
223
-
223
+
224
224
实现的扩展点:`PreFilter`,`Filter`。
225
225
<!--
226
226
- `NodePreferAvoidPods` : Scores nodes according to the node
227
227
{{< glossary_tooltip text=" " term_id="annotation" >}}
228
228
` scheduler.alpha.kubernetes.io/preferAvoidPods` .
229
229
Extension points : ` Score` .
230
230
-->
231
- - ` NodePreferAvoidPods` :基于节点的 {{< glossary_tooltip text="注解" term_id="annotation" >}}
231
+ - ` NodePreferAvoidPods` :基于节点的 {{< glossary_tooltip text="注解" term_id="annotation" >}}
232
232
` scheduler.alpha.kubernetes.io/preferAvoidPods` 打分。
233
-
233
+
234
234
实现的扩展点:`Score`。
235
235
<!--
236
236
- `NodeAffinity` : Implements
@@ -240,130 +240,130 @@ extension points:
240
240
-->
241
241
- ` NodeAffinity` :实现了[节点选择器](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
242
242
和[节点亲和性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity)。
243
-
243
+
244
244
实现的扩展点:`Filter`,`Score`.
245
245
<!--
246
246
- `PodTopologySpread` : Implements
247
247
[Pod topology spread](/docs/concepts/workloads/pods/pod-topology-spread-constraints/).
248
248
Extension points : ` PreFilter` , `Filter`, `PreScore`, `Score`.
249
249
-->
250
250
- ` PodTopologySpread` :实现了 [Pod 拓扑分布](/zh/docs/concepts/workloads/pods/pod-topology-spread-constraints/)。
251
-
251
+
252
252
实现的扩展点:`PreFilter`,`Filter`,`PreScore`,`Score`。
253
253
<!--
254
254
- `NodeUnschedulable` : Filters out nodes that have `.spec.unschedulable` set to
255
255
true.
256
256
Extension points : ` Filter` .
257
257
-->
258
258
- ` NodeUnschedulable` :过滤 `.spec.unschedulable` 值为 true 的节点。
259
-
259
+
260
260
实现的扩展点:`Filter`。
261
261
<!--
262
262
- `NodeResourcesFit` : Checks if the node has all the resources that the Pod is
263
263
requesting.
264
264
Extension points : ` PreFilter` , `Filter`.
265
265
-->
266
266
- ` NodeResourcesFit` :检查节点是否拥有 Pod 请求的所有资源。
267
-
267
+
268
268
实现的扩展点:`PreFilter`,`Filter`。
269
269
<!--
270
270
- `NodeResourcesBalancedAllocation` : Favors nodes that would obtain a more
271
271
balanced resource usage if the Pod is scheduled there.
272
272
Extension points : ` Score` .
273
273
-->
274
274
- ` NodeResourcesBalancedAllocation` :调度 Pod 时,选择资源使用更为均衡的节点。
275
-
275
+
276
276
实现的扩展点:`Score`。
277
277
<!--
278
278
- `NodeResourcesLeastAllocated` : Favors nodes that have a low allocation of
279
279
resources.
280
280
Extension points : ` Score` .
281
281
-->
282
282
- ` NodeResourcesLeastAllocated` :选择资源分配较少的节点。
283
-
283
+
284
284
实现的扩展点:`Score`。
285
285
<!--
286
286
- `VolumeBinding` : Checks if the node has or if it can bind the requested
287
287
{{< glossary_tooltip text="volumes" term_id="volume" >}}.
288
288
Extension points : ` PreFilter` , `Filter`, `Reserve`, `PreBind`.
289
289
-->
290
290
- ` VolumeBinding` :检查节点是否有请求的卷,或是否可以绑定请求的卷。
291
-
291
+
292
292
实现的扩展点 : ` PreFilter` ,`Filter`,`Reserve`,`PreBind`。
293
- <!--
293
+ <!--
294
294
- `VolumeRestrictions` : Checks that volumes mounted in the node satisfy
295
295
restrictions that are specific to the volume provider.
296
- Extension points : ` Filter` .
296
+ Extension points : ` Filter` .
297
297
-->
298
298
- ` VolumeRestrictions` :检查挂载到节点上的卷是否满足卷提供程序的限制。
299
-
299
+
300
300
实现的扩展点:`Filter`。
301
301
<!--
302
302
- `VolumeZone` : Checks that volumes requested satisfy any zone requirements they
303
303
might have.
304
304
Extension points : ` Filter` .
305
305
-->
306
306
- ` VolumeZone` :检查请求的卷是否在任何区域都满足。
307
-
307
+
308
308
实现的扩展点:`Filter`。
309
- <!--
309
+ <!--
310
310
- `NodeVolumeLimits` : Checks that CSI volume limits can be satisfied for the
311
311
node.
312
- Extension points : ` Filter` .
312
+ Extension points : ` Filter` .
313
313
-->
314
314
- ` NodeVolumeLimits` :检查该节点是否满足 CSI 卷限制。
315
-
315
+
316
316
实现的扩展点:`Filter`。
317
317
<!--
318
318
- `EBSLimits` : Checks that AWS EBS volume limits can be satisfied for the node.
319
319
Extension points : ` Filter` .
320
320
-->
321
321
- ` EBSLimits` :检查节点是否满足 AWS EBS 卷限制。
322
-
322
+
323
323
实现的扩展点:`Filter`。
324
324
<!--
325
325
- `GCEPDLimits` : Checks that GCP-PD volume limits can be satisfied for the node.
326
326
Extension points : ` Filter` .
327
327
-->
328
328
- ` GCEPDLimits` :检查该节点是否满足 GCP-PD 卷限制。
329
-
329
+
330
330
实现的扩展点:`Filter`。
331
331
<!--
332
332
- `AzureDiskLimits` : Checks that Azure disk volume limits can be satisfied for
333
333
the node.
334
334
Extension points : ` Filter` .
335
335
-->
336
336
- ` AzureDiskLimits` :检查该节点是否满足 Azure 卷限制。
337
-
337
+
338
338
实现的扩展点:`Filter`。
339
339
<!--
340
340
- `InterPodAffinity` : Implements
341
341
[inter-Pod affinity and anti-affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity).
342
342
Extension points : ` PreFilter` , `Filter`, `PreScore`, `Score`.
343
343
-->
344
344
- ` InterPodAffinity` :实现 [Pod 间亲和性与反亲和性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity)。
345
-
345
+
346
346
实现的扩展点:`PreFilter`,`Filter`,`PreScore`,`Score`。
347
347
<!--
348
348
- `PrioritySort` : Provides the default priority based sorting.
349
349
Extension points : ` QueueSort` .
350
350
-->
351
351
- ` PrioritySort` :提供默认的基于优先级的排序。
352
-
352
+
353
353
实现的扩展点:`QueueSort`。
354
354
<!--
355
355
- `DefaultBinder` : Provides the default binding mechanism.
356
356
Extension points : ` Bind` .
357
357
-->
358
358
- ` DefaultBinder` :提供默认的绑定机制。
359
-
359
+
360
360
实现的扩展点:`Bind`。
361
361
<!--
362
362
- `DefaultPreemption` : Provides the default preemption mechanism.
363
363
Extension points : ` PostFilter` .
364
364
-->
365
365
- ` DefaultPreemption` :提供默认的抢占机制。
366
-
366
+
367
367
实现的扩展点:`PostFilter`。
368
368
369
369
<!--
@@ -378,39 +378,39 @@ that are not enabled by default:
378
378
Extension points : ` Score` .
379
379
-->
380
380
- ` NodeResourcesMostAllocated` :选择已分配资源多的节点。
381
-
381
+
382
382
实现的扩展点:`Score`。
383
383
<!--
384
384
- `RequestedToCapacityRatio` : Favor nodes according to a configured function of
385
385
the allocated resources.
386
386
Extension points : ` Score` .
387
387
-->
388
388
- ` RequestedToCapacityRatio` :根据已分配资源的某函数设置选择节点。
389
-
389
+
390
390
实现的扩展点:`Score`。
391
391
<!--
392
392
- `NodeResourceLimits` : Favors nodes that satisfy the Pod resource limits.
393
393
Extension points : ` PreScore` , `Score`.
394
394
-->
395
395
- ` NodeResourceLimits` :选择满足 Pod 资源限制的节点。
396
-
396
+
397
397
实现的扩展点:`PreScore`,`Score`。
398
398
<!--
399
399
- `CinderVolume` : Checks that OpenStack Cinder volume limits can be satisfied
400
400
for the node.
401
401
Extension points : ` Filter` .
402
402
-->
403
403
- ` CinderVolume` :检查该节点是否满足 OpenStack Cinder 卷限制。
404
-
404
+
405
405
实现的扩展点:`Filter`。
406
406
<!--
407
407
- `NodeLabel` : Filters and / or scores a node according to configured
408
408
{{< glossary_tooltip text="label(s)" term_id="label" >}}.
409
409
Extension points : ` Filter` , `Score`.
410
410
-->
411
- - ` NodeLabel` :根据配置的 {{< glossary_tooltip text="标签" term_id="label" >}}
411
+ - ` NodeLabel` :根据配置的 {{< glossary_tooltip text="标签" term_id="label" >}}
412
412
过滤节点和/或给节点打分。
413
-
413
+
414
414
实现的扩展点:`Filter`,`Score`。
415
415
<!--
416
416
- `ServiceAffinity` : Checks that Pods that belong to a
@@ -422,7 +422,7 @@ that are not enabled by default:
422
422
- ` ServiceAffinity` :检查属于某个 {{< glossary_tooltip term_id="service" >}} 的 Pod
423
423
与配置的标签所定义的节点集是否适配。
424
424
这个插件还支持将属于某个 Service 的 Pod 分散到各个节点。
425
-
425
+
426
426
实现的扩展点:`PreFilter`,`Filter`,`Score`。
427
427
428
428
<!-- # ## Multiple profiles -->
@@ -462,14 +462,14 @@ profiles:
462
462
Pods that want to be scheduled according to a specific profile can include
463
463
the corresponding scheduler name in its `.spec.schedulerName`.
464
464
-->
465
- 希望根据特定配置文件调度的 Pod,可以在 `.spec.schedulerName` 字段指定相应的调度器名称。
465
+ 对于那些希望根据特定配置文件来进行调度的 Pod,可以在 `.spec.schedulerName` 字段指定相应的调度器名称。
466
466
467
467
<!--
468
468
By default, one profile with the scheduler name `default-scheduler` is created.
469
469
This profile includes the default plugins described above. When declaring more
470
470
than one profile, a unique scheduler name for each of them is required.
471
471
-->
472
- 默认情况下,将创建一个名为 `default-scheduler` 的配置文件。
472
+ 默认情况下,将创建一个调度器名为 `default-scheduler` 的配置文件。
473
473
这个配置文件包括上面描述的所有默认插件。
474
474
声明多个配置文件时,每个配置文件中调度器名称必须唯一。
475
475
@@ -478,8 +478,8 @@ If a Pod doesn't specify a scheduler name, kube-apiserver will set it to
478
478
` default-scheduler` . Therefore, a profile with this scheduler name should exist
479
479
to get those pods scheduled.
480
480
-->
481
- 如果 Pod 未指定调度器名称,kube-apiserver 将会把它设置为 `default-scheduler`。
482
- 因此,应该存在一个名为 `default-scheduler` 的配置文件来调度这些 Pod。
481
+ 如果 Pod 未指定调度器名称,kube-apiserver 将会把调度器名设置为 `default-scheduler`。
482
+ 因此,应该存在一个调度器名为 `default-scheduler` 的配置文件来调度这些 Pod。
483
483
484
484
{{< note >}}
485
485
<!--
@@ -488,7 +488,7 @@ Events for leader election use the scheduler name of the first profile in the
488
488
list.
489
489
-->
490
490
Pod 的调度事件把 `.spec.schedulerName` 字段值作为 ReportingController。
491
- 领导者选择事件使用列表中第一个配置文件的调度器名称 。
491
+ 领导者选举事件使用列表中第一个配置文件的调度器名称 。
492
492
{{< /note >}}
493
493
494
494
{{< note >}}
@@ -498,7 +498,7 @@ the same configuration parameters (if applicable). This is because the scheduler
498
498
only has one pending pods queue.
499
499
-->
500
500
所有配置文件必须在 QueueSort 扩展点使用相同的插件,并具有相同的配置参数(如果适用)。
501
- 这是因为调度器只有一个的队列保存悬决的 Pod。
501
+ 这是因为调度器只有一个保存 pending 状态 Pod 的队列 。
502
502
503
503
{{< /note >}}
504
504
@@ -509,4 +509,4 @@ only has one pending pods queue.
509
509
* Learn about [scheduling](/docs/concepts/scheduling-eviction/kube-scheduler/)
510
510
-->
511
511
* 阅读 [kube-scheduler 参考](/zh/docs/reference/command-line-tools-reference/kube-scheduler/)
512
- * 了解[调度](/zh/docs/concepts/scheduling-eviction/kube-scheduler/)
512
+ * 了解[调度](/zh/docs/concepts/scheduling-eviction/kube-scheduler/)
0 commit comments