@@ -16,14 +16,15 @@ weight: 60
16
16
{{< feature-state for_k8s_version="v1.19" state="stable" >}}
17
17
18
18
<!--
19
- The scheduling framework is a pluggable architecture for the Kubernetes scheduler.
20
- It adds a new set of "plugin" APIs to the existing scheduler. Plugins are compiled into the scheduler. The APIs allow most scheduling features to be implemented as plugins, while keeping the
21
- scheduling "core" lightweight and maintainable. Refer to the [design proposal of the
22
- scheduling framework][kep] for more technical information on the design of the
23
- framework.
24
- -->
25
- 调度框架是面向 Kubernetes 调度器的一种插件架构,
26
- 它为现有的调度器添加了一组新的“插件” API。插件会被编译到调度器之中。
19
+ The _scheduling framework_ is a pluggable architecture for the Kubernetes scheduler.
20
+ It consists of a set of "plugin" APIs that are compiled directly into the scheduler.
21
+ These APIs allow most scheduling features to be implemented as plugins,
22
+ while keeping the scheduling "core" lightweight and maintainable. Refer to the
23
+ [design proposal of the scheduling framework][kep] for more technical information on
24
+ the design of the framework.
25
+ -->
26
+ ** 调度框架** 是面向 Kubernetes 调度器的一种插件架构,
27
+ 它由一组直接编译到调度程序中的“插件” API 组成。
27
28
这些 API 允许大多数调度功能以插件的形式实现,同时使调度“核心”保持简单且可维护。
28
29
请参考[ 调度框架的设计提案] ( https://github.com/kubernetes/enhancements/blob/master/keps/sig-scheduling/624-scheduling-framework/README.md )
29
30
获取框架设计的更多技术信息。
@@ -33,9 +34,9 @@ framework.
33
34
<!-- body -->
34
35
35
36
<!--
36
- # Framework workflow
37
+ ## Framework workflow
37
38
-->
38
- # 框架工作流程 {#framework-workflow}
39
+ ## 框架工作流程 {#framework-workflow}
39
40
40
41
<!--
41
42
The Scheduling Framework defines a few extension points. Scheduler plugins
@@ -46,15 +47,15 @@ can change the scheduling decisions and some are informational only.
46
47
这些插件中的一些可以改变调度决策,而另一些仅用于提供信息。
47
48
48
49
<!--
49
- Each attempt to schedule one Pod is split into two phases, the **scheduling
50
- cycle** and the **binding cycle**.
50
+ Each attempt to schedule one Pod is split into two phases, the
51
+ **scheduling cycle** and the **binding cycle**.
51
52
-->
52
- 每次调度一个 Pod 的尝试都分为两个阶段,即 ** 调度周期** 和 ** 绑定周期** 。
53
+ 每次调度一个 Pod 的尝试都分为两个阶段,即** 调度周期** 和 ** 绑定周期** 。
53
54
54
55
<!--
55
- ## Scheduling Cycle & Binding Cycle
56
+ ### Scheduling Cycle & Binding Cycle
56
57
-->
57
- ## 调度周期和绑定周期 {#scheduling-cycle-and-binding-cycle}
58
+ ### 调度周期和绑定周期 {#scheduling-cycle-and-binding-cycle}
58
59
59
60
<!--
60
61
The scheduling cycle selects a node for the Pod, and the binding cycle applies
@@ -95,7 +96,7 @@ stateful tasks.
95
96
一个插件可能实现多个接口,以执行更为复杂或有状态的任务。
96
97
97
98
<!--
98
- Some interfaces match the scheduler extension points which can be configured through
99
+ Some interfaces match the scheduler extension points which can be configured through
99
100
[Scheduler Configuration](/docs/reference/scheduling/config/#extension-points).
100
101
-->
101
102
某些接口与可以通过[ 调度器配置] ( /zh-cn/docs/reference/scheduling/config/#extension-points ) 来设置的调度器扩展点匹配。
@@ -131,21 +132,21 @@ For more details about how internal scheduler queues work, read
131
132
### EnqueueExtension
132
133
133
134
<!--
134
- EnqueueExtension is the interface where the plugin can control
135
+ EnqueueExtension is the interface where the plugin can control
135
136
whether to retry scheduling of Pods rejected by this plugin, based on changes in the cluster.
136
137
Plugins that implement PreEnqueue, PreFilter, Filter, Reserve or Permit should implement this interface.
137
138
-->
138
- EnqueueExtension 作为一个接口,插件可以在此接口之上根据集群中的变化来控制是否重新尝试调度被此插件拒绝的 Pod。
139
- 实现 PreEnqueue、PreFilter、Filter、Reserve 或 Permit 的插件应实现此接口。
139
+ EnqueueExtension 作为一个接口,插件可以在此接口之上根据集群中的变化来控制是否重新尝试调度被此插件拒绝的
140
+ Pod。 实现 PreEnqueue、PreFilter、Filter、Reserve 或 Permit 的插件应实现此接口。
140
141
141
- #### QueueingHint
142
+ ### QueueingHint
142
143
143
144
{{< feature-state for_k8s_version="v1.28" state="beta" >}}
144
145
145
146
<!--
146
- QueueingHint is a callback function for deciding whether a Pod can be requeued to the active queue or backoff queue.
147
+ QueueingHint is a callback function for deciding whether a Pod can be requeued to the active queue or backoff queue.
147
148
It's executed every time a certain kind of event or change happens in the cluster.
148
- When the QueueingHint finds that the event might make the Pod schedulable,
149
+ When the QueueingHint finds that the event might make the Pod schedulable,
149
150
the Pod is put into the active queue or the backoff queue
150
151
so that the scheduler will retry the scheduling of the Pod.
151
152
-->
@@ -228,7 +229,7 @@ will not be called. A typical PostFilter implementation is preemption, which
228
229
tries to make the pod schedulable by preempting other Pods.
229
230
-->
230
231
这些插件在 Filter 阶段后调用,但仅在该 Pod 没有可行的节点时调用。
231
- 插件按其配置的顺序调用。如果任何 PostFilter 插件标记节点为“ Schedulable” ,
232
+ 插件按其配置的顺序调用。如果任何 PostFilter 插件标记节点为 " Schedulable" ,
232
233
则其余的插件不会调用。典型的 PostFilter 实现是抢占,试图通过抢占其他 Pod
233
234
的资源使该 Pod 可以调度。
234
235
@@ -242,7 +243,7 @@ These plugins are used to perform "pre-scoring" work, which generates a sharable
242
243
state for Score plugins to use. If a PreScore plugin returns an error, the
243
244
scheduling cycle is aborted.
244
245
-->
245
- 这些插件用于执行 “前置评分(pre-scoring)” 工作,即生成一个可共享状态供 Score 插件使用。
246
+ 这些插件用于执行“前置评分(pre-scoring)”工作,即生成一个可共享状态供 Score 插件使用。
246
247
如果 PreScore 插件返回错误,则调度周期将终止。
247
248
248
249
<!--
@@ -274,8 +275,8 @@ called with the [Score](#scoring) results from the same plugin. This is called
274
275
once per plugin per scheduling cycle.
275
276
-->
276
277
这些插件用于在调度器计算 Node 排名之前修改分数。
277
- 在此扩展点注册的插件被调用时会使用同一插件的 [ Score] ( #scoring ) 结果。
278
- 每个插件在每个调度周期调用一次。
278
+ 在此扩展点注册的插件被调用时会使用同一插件的 [ Score] ( #scoring )
279
+ 结果。 每个插件在每个调度周期调用一次。
279
280
280
281
<!--
281
282
For example, suppose a plugin `BlinkingLightScorer` ranks Nodes based on how
@@ -334,7 +335,7 @@ on a node are being reserved and unreserved for a given Pod.
334
335
-->
335
336
实现了 Reserve 接口的插件,拥有两个方法,即 ` Reserve ` 和 ` Unreserve ` ,
336
337
他们分别支持两个名为 Reserve 和 Unreserve 的信息传递性质的调度阶段。
337
- 维护运行时状态的插件(又称 "有状态插件")应该使用这两个阶段,
338
+ 维护运行时状态的插件(又称"有状态插件")应该使用这两个阶段,
338
339
以便在节点上的资源被保留和解除保留给特定的 Pod 时,得到调度器的通知。
339
340
340
341
<!--
@@ -378,8 +379,8 @@ state, it will either trigger [Unreserve](#unreserve) plugins (on failure) or
378
379
[PostBind](#post-bind) plugins (on success) at the end of the binding cycle.
379
380
-->
380
381
这个是调度周期的最后一步。
381
- 一旦 Pod 处于保留状态,它将在绑定周期结束时触发 [ Unreserve] ( #unreserve ) 插件
382
- (失败时)或 [ PostBind] ( #post-bind ) 插件(成功时)。
382
+ 一旦 Pod 处于保留状态,它将在绑定周期结束时触发 [ Unreserve] ( #unreserve ) 插件(失败时)或
383
+ [ PostBind] ( #post-bind ) 插件(成功时)。
383
384
384
385
<!--
385
386
### Permit
@@ -391,7 +392,7 @@ _Permit_ plugins are invoked at the end of the scheduling cycle for each Pod, to
391
392
prevent or delay the binding to the candidate node. A permit plugin can do one of
392
393
the three things:
393
394
-->
394
- _ Permit _ 插件在每个 Pod 调度周期的最后调用,用于防止或延迟 Pod 的绑定。
395
+ ** Permit ** 插件在每个 Pod 调度周期的最后调用,用于防止或延迟 Pod 的绑定。
395
396
一个允许插件可以做以下三件事之一:
396
397
397
398
<!--
@@ -418,22 +419,22 @@ _Permit_ 插件在每个 Pod 调度周期的最后调用,用于防止或延迟
418
419
and the Pod is returned to the scheduling queue, triggering the
419
420
Unreserve phase in [Reserve plugins](#reserve).
420
421
-->
421
- 3 . ** 等待** (带有超时)\
422
- 如果一个 Permit 插件返回 “等待” 结果,则 Pod 将保持在一个内部的 “等待中”
422
+ 3 . ** 等待** (带有超时)\
423
+ 如果一个 Permit 插件返回“等待”结果,则 Pod 将保持在一个内部的“等待中”
423
424
的 Pod 列表,同时该 Pod 的绑定周期启动时即直接阻塞直到得到批准。
424
- 如果超时发生,** 等待** 变成 ** 拒绝** ,并且 Pod
425
- 将返回调度队列,从而触发 [ Reserve 插件] ( #reserve ) 中的 Unreserve 阶段。
425
+ 如果超时发生,** 等待** 变成 ** 拒绝** ,并且 Pod 将返回调度队列,从而触发
426
+ [ Reserve 插件] ( #reserve ) 中的 Unreserve 阶段。
426
427
427
428
{{< note >}}
428
429
<!--
429
430
While any plugin can access the list of "waiting" Pods and approve them
430
- (see [`FrameworkHandle`](https://git.k8s.io/enhancements/keps/sig-scheduling/624-scheduling-framework#frameworkhandle)), we expect only the permit
431
- plugins to approve binding of reserved Pods that are in "waiting" state. Once a Pod
432
- is approved, it is sent to the [PreBind](#pre-bind) phase.
431
+ (see [`FrameworkHandle`](https://git.k8s.io/enhancements/keps/sig-scheduling/624-scheduling-framework#frameworkhandle)),
432
+ we expect only the permit plugins to approve binding of reserved Pods that are in "waiting" state.
433
+ Once a Pod is approved, it is sent to the [PreBind](#pre-bind) phase.
433
434
-->
434
- 尽管任何插件可以访问 “等待中” 状态的 Pod 列表并批准它们
435
- ( 查看 [ ` FrameworkHandle ` ] ( https://git.k8s.io/enhancements/keps/sig-scheduling/624-scheduling-framework#frameworkhandle ) ) 。
436
- 我们期望只有允许插件可以批准处于 “等待中” 状态的预留 Pod 的绑定。
435
+ 尽管任何插件可以访问“等待中”状态的 Pod 列表并批准它们
436
+ ( 查看 [ ` FrameworkHandle ` ] ( https://git.k8s.io/enhancements/keps/sig-scheduling/624-scheduling-framework#frameworkhandle ) ) 。
437
+ 我们期望只有允许插件可以批准处于“等待中”状态的预留 Pod 的绑定。
437
438
一旦 Pod 被批准了,它将发送到 [ PreBind] ( #pre-bind ) 阶段。
438
439
{{< /note >}}
439
440
@@ -486,7 +487,6 @@ to clean up associated resources.
486
487
这是个信息传递性质的接口。
487
488
PostBind 插件在 Pod 成功绑定后被调用。这是绑定周期的结尾,可用于清理相关的资源。
488
489
489
-
490
490
<!--
491
491
## Plugin API
492
492
-->
@@ -531,8 +531,7 @@ enabled by default.
531
531
-->
532
532
你可以在调度器配置中启用或禁用插件。
533
533
如果你在使用 Kubernetes v1.18 或更高版本,
534
- 大部分调度[ 插件] ( /zh-cn/docs/reference/scheduling/config/#scheduling-plugins )
535
- 都在使用中且默认启用。
534
+ 大部分调度[ 插件] ( /zh-cn/docs/reference/scheduling/config/#scheduling-plugins ) 都在使用中且默认启用。
536
535
537
536
<!--
538
537
In addition to default plugins, you can also implement your own scheduling
0 commit comments