@@ -8,7 +8,7 @@ title: Scheduler Configuration
8
8
content_type: concept
9
9
weight: 20
10
10
-->
11
- {{< feature-state for_k8s_version="v1.19 " state="beta " >}}
11
+ {{< feature-state for_k8s_version="v1.25 " state="stable " >}}
12
12
13
13
<!--
14
14
You can customize the behavior of the `kube-scheduler` by writing a configuration
@@ -30,27 +30,39 @@ by implementing one or more of these extension points.
30
30
31
31
<!--
32
32
You can specify scheduling profiles by running `kube-scheduler --config <filename>`,
33
- using the
34
- KubeSchedulerConfiguration ([v1beta2 ](/docs/reference/config-api/kube-scheduler-config.v1beta2 /)
35
- or [v1beta3 ](/docs/reference/config-api/kube-scheduler-config.v1beta3 /))
33
+ using the
34
+ KubeSchedulerConfiguration ([v1beta3 ](/docs/reference/config-api/kube-scheduler-config.v1beta3 /)
35
+ or [v1 ](/docs/reference/config-api/kube-scheduler-config.v1 /))
36
36
struct.
37
37
-->
38
38
你可以通过运行 ` kube-scheduler --config <filename> ` 来设置调度模板,
39
- 使用 KubeSchedulerConfiguration ( [ v1beta2 ] ( /zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta2 / )
40
- 或者 [ v1beta3 ] ( /zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta3 / ) ) 结构体。
39
+ 使用 KubeSchedulerConfiguration( [ v1beta3 ] ( /zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta3 / )
40
+ 或 [ v1 ] ( /zh-cn/docs/reference/config-api/kube-scheduler-config.v1 / ) )结构体。
41
41
42
42
<!--
43
43
A minimal configuration looks as follows:
44
44
-->
45
45
最简单的配置如下:
46
46
47
47
``` yaml
48
- apiVersion : kubescheduler.config.k8s.io/v1beta2
48
+ apiVersion : kubescheduler.config.k8s.io/v1
49
49
kind : KubeSchedulerConfiguration
50
50
clientConnection :
51
51
kubeconfig : /etc/srv/kubernetes/kube-scheduler/kubeconfig
52
52
` ` `
53
53
54
+ {{< note >}}
55
+ <!--
56
+ KubeSchedulerConfiguration [v1beta2](/docs/reference/config-api/kube-scheduler-config.v1beta2/)
57
+ is deprecated in v1.25 and will be removed in v1.26. Please migrate KubeSchedulerConfiguration to
58
+ [v1beta3](/docs/reference/config-api/kube-scheduler-config.v1beta3/) or [v1](/docs/reference/config-api/kube-scheduler-config.v1/)
59
+ before upgrading Kubernetes to v1.25.
60
+ -->
61
+ KubeSchedulerConfiguration [v1beta2](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta2/)
62
+ 在 v1.25 中已弃用,并将在 v1.26 中移除。在将 Kubernetes 升级到 v1.25 之前,请将 KubeSchedulerConfiguration 迁移到
63
+ [v1beta3](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta3/) 或 [v1](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1/)。
64
+ {{< /note >}}
65
+
54
66
<!--
55
67
## Profiles
56
68
-->
@@ -153,7 +165,7 @@ extension points:
153
165
-->
154
166
11. `postBind`:这是一个信息扩展点,在 Pod 绑定了节点之后调用。
155
167
<!--
156
- 1. `multiPoint` : This is a config-only field that allows plugins to be enabled
168
+ 1. `multiPoint` : This is a config-only field that allows plugins to be enabled
157
169
or disabled for all of their applicable extension points simultaneously.
158
170
-->
159
171
12. `multiPoint`:这是一个仅配置字段,允许同时为所有适用的扩展点启用或禁用插件。
@@ -165,7 +177,7 @@ or enable your own. For example:
165
177
对每个扩展点,你可以禁用[默认插件](#scheduling-plugins)或者是启用自己的插件,例如:
166
178
167
179
` ` ` yaml
168
- apiVersion: kubescheduler.config.k8s.io/v1beta2
180
+ apiVersion: kubescheduler.config.k8s.io/v1
169
181
kind: KubeSchedulerConfiguration
170
182
profiles:
171
183
- plugins:
@@ -391,20 +403,6 @@ that are not enabled by default:
391
403
-->
392
404
你也可以通过组件配置 API 启用以下插件(默认不启用):
393
405
394
- <!--
395
- - `SelectorSpread` : Favors spreading across nodes for Pods that belong to
396
- {{< glossary_tooltip text="Services" term_id="service" >}},
397
- {{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} and
398
- {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}}.
399
- Extension points : ` preScore` , `score`.
400
- -->
401
- - ` SelectorSpread` :偏向把属于
402
- {{< glossary_tooltip text="Services" term_id="service" >}},
403
- {{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} 和
404
- {{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} 的 Pod 跨节点分布。
405
-
406
- 实现的扩展点:`preScore`、`score`。
407
-
408
406
<!--
409
407
- `CinderLimits` : Checks that [OpenStack Cinder](https://docs.openstack.org/cinder/)
410
408
volume limits can be satisfied for the node.
@@ -433,7 +431,7 @@ disabled.
433
431
使用下面的配置样例,调度器将运行两个配置文件:一个使用默认插件,另一个禁用所有打分插件。
434
432
435
433
` ` ` yaml
436
- apiVersion: kubescheduler.config.k8s.io/v1beta2
434
+ apiVersion: kubescheduler.config.k8s.io/v1
437
435
kind: KubeSchedulerConfiguration
438
436
profiles:
439
437
- schedulerName: default-scheduler
@@ -513,7 +511,7 @@ points, the profile config looks like:
513
511
要为其所有可用的扩展点启用 `MyPlugin`,配置文件配置如下所示:
514
512
515
513
` ` ` yaml
516
- apiVersion: kubescheduler.config.k8s.io/v1beta3
514
+ apiVersion: kubescheduler.config.k8s.io/v1
517
515
kind: KubeSchedulerConfiguration
518
516
profiles:
519
517
- schedulerName: multipoint-scheduler
@@ -530,7 +528,7 @@ points, like so:
530
528
这相当于为所有扩展点手动启用 `MyPlugin`,如下所示:
531
529
532
530
` ` ` yaml
533
- apiVersion: kubescheduler.config.k8s.io/v1beta3
531
+ apiVersion: kubescheduler.config.k8s.io/v1
534
532
kind: KubeSchedulerConfiguration
535
533
profiles:
536
534
- schedulerName: non-multipoint-scheduler
@@ -562,12 +560,12 @@ the `disabled` field for that extension point. This works with disabling default
562
560
plugins, non-default plugins, or with the wildcard (`'*'`) to disable all plugins.
563
561
An example of this, disabling `Score` and `PreScore`, would be :
564
562
-->
565
- 可以使用该扩展点的 `disabled` 字段将特定扩展点从 `MultiPoint` 扩展中排除。
566
- 这适用于禁用默认插件、非默认插件或使用通配符 (`'*'`) 来禁用所有插件。
563
+ 可以使用该扩展点的 `disabled` 字段将特定扩展点从 `MultiPoint` 扩展中排除。
564
+ 这适用于禁用默认插件、非默认插件或使用通配符 (`'*'`) 来禁用所有插件。
567
565
禁用 `Score` 和 `PreScore` 的一个例子是:
568
566
569
567
` ` ` yaml
570
- apiVersion: kubescheduler.config.k8s.io/v1beta3
568
+ apiVersion: kubescheduler.config.k8s.io/v1
571
569
kind: KubeSchedulerConfiguration
572
570
profiles:
573
571
- schedulerName: non-multipoint-scheduler
@@ -584,19 +582,20 @@ profiles:
584
582
` ` `
585
583
586
584
<!--
587
- In `v1beta3`, all [default plugins](#scheduling-plugins) are enabled internally through `MultiPoint`.
585
+ Starting from `kubescheduler.config.k8s.io/v1beta3`, all [default plugins](#scheduling-plugins)
586
+ are enabled internally through `MultiPoint`.
588
587
However, individual extension points are still available to allow flexible
589
588
reconfiguration of the default values (such as ordering and Score weights). For
590
589
example, consider two Score plugins `DefaultScore1` and `DefaultScore2`, each with
591
590
a weight of `1`. They can be reordered with different weights like so :
592
591
-->
593
- 在 ` v1beta3` 中 ,所有 [默认插件](#scheduling-plugins) 都通过 `MultiPoint` 在内部启用。
594
- 但是,仍然可以使用单独的扩展点来灵活地重新配置默认值(例如排序和分数权重)。
595
- 例如,考虑两个Score插件 `DefaultScore1` 和 `DefaultScore2` ,每个插件的权重为 `1` 。
592
+ 从 `kubescheduler.config.k8s.io/ v1beta3` 开始 ,所有[默认插件](#scheduling-plugins)都通过 `MultiPoint` 在内部启用。
593
+ 但是,仍然可以使用单独的扩展点来灵活地重新配置默认值(例如排序和分数权重)。
594
+ 例如,考虑两个 Score 插件 `DefaultScore1` 和 `DefaultScore2`,每个插件的权重为 `1`。
596
595
它们可以用不同的权重重新排序,如下所示:
597
596
598
597
` ` ` yaml
599
- apiVersion: kubescheduler.config.k8s.io/v1beta3
598
+ apiVersion: kubescheduler.config.k8s.io/v1
600
599
kind: KubeSchedulerConfiguration
601
600
profiles:
602
601
- schedulerName: multipoint-scheduler
@@ -614,9 +613,9 @@ This is because plugins set through specific extension points will always take p
614
613
over `MultiPoint` plugins. So, this snippet essentially re-orders the two plugins
615
614
without needing to specify both of them.
616
615
-->
617
- 在这个例子中,没有必要在 `MultiPoint` 中明确指定插件,因为它们是默认插件。
618
- ` Score` 中指定的唯一插件是 `DefaultScore2`。
619
- 这是因为通过特定扩展点设置的插件将始终优先于 `MultiPoint` 插件。
616
+ 在这个例子中,没有必要在 `MultiPoint` 中明确指定插件,因为它们是默认插件。
617
+ ` Score` 中指定的唯一插件是 `DefaultScore2`。
618
+ 这是因为通过特定扩展点设置的插件将始终优先于 `MultiPoint` 插件。
620
619
因此,此代码段实质上重新排序了这两个插件,而无需同时指定它们。
621
620
622
621
<!--
@@ -658,7 +657,7 @@ A valid sample configuration for these plugins would be:
658
657
这些插件的一个有效示例配置是:
659
658
660
659
` ` ` yaml
661
- apiVersion: kubescheduler.config.k8s.io/v1beta3
660
+ apiVersion: kubescheduler.config.k8s.io/v1
662
661
kind: KubeSchedulerConfiguration
663
662
profiles:
664
663
- schedulerName: multipoint-scheduler
@@ -684,7 +683,7 @@ Note that there is no error for re-declaring a `MultiPoint` plugin in a specific
684
683
extension point. The re-declaration is ignored (and logged), as specific extension points
685
684
take precedence.
686
685
-->
687
- 请注意,在特定扩展点中重新声明 `MultiPoint` 插件不会出错。
686
+ 请注意,在特定扩展点中重新声明 `MultiPoint` 插件不会出错。
688
687
重新声明被忽略(并记录),因为特定的扩展点优先。
689
688
690
689
<!--
@@ -715,14 +714,14 @@ profiles:
715
714
- schedulerName: multipoint-scheduler
716
715
plugins:
717
716
718
- # Disable the default QueueSort plugin
717
+ # 禁用默认的 QueueSort 插件
719
718
queueSort:
720
719
enabled:
721
720
- name: 'CustomQueueSort'
722
721
disabled:
723
722
- name: 'DefaultQueueSort'
724
723
725
- # Enable custom Filter plugins
724
+ # 启用自定义的 Filter 插件
726
725
filter:
727
726
enabled:
728
727
- name: 'CustomPlugin1'
@@ -731,7 +730,7 @@ profiles:
731
730
disabled:
732
731
- name: 'DefaultPlugin1'
733
732
734
- # Enable and reorder custom score plugins
733
+ # 启用并重新排序自定义的打分插件
735
734
score:
736
735
enabled:
737
736
- name: 'DefaultPlugin2'
@@ -750,6 +749,7 @@ as well as its seamless integration with the existing methods for configuring ex
750
749
# # Scheduler configuration migrations
751
750
-->
752
751
# # 调度程序配置迁移 {#scheduler-configuration-migrations}
752
+
753
753
{{< tabs name="tab_with_md" >}}
754
754
{{% tab name="v1beta1 → v1beta2" %}}
755
755
@@ -763,9 +763,9 @@ as well as its seamless integration with the existing methods for configuring ex
763
763
with a `scoreStrategy` that is similar to :
764
764
-->
765
765
* 在 v1beta2 配置版本中,你可以为 `NodeResourcesFit` 插件使用新的 score 扩展。
766
- 新的扩展结合了 `NodeResourcesLeastAllocated`、`NodeResourcesMostAllocated` 和 `RequestedToCapacityRatio` 插件的功能。
767
- 例如,如果你之前使用了 `NodeResourcesMostAllocated` 插件,
768
- 则可以改用 `NodeResourcesFit`(默认启用)并添加一个 `pluginConfig` 和 `scoreStrategy`,类似于:
766
+ 新的扩展结合了 `NodeResourcesLeastAllocated`、`NodeResourcesMostAllocated` 和 `RequestedToCapacityRatio` 插件的功能。
767
+ 例如,如果你之前使用了 `NodeResourcesMostAllocated` 插件,
768
+ 则可以改用 `NodeResourcesFit`(默认启用)并添加一个 `pluginConfig` 和 `scoreStrategy`,类似于:
769
769
770
770
` ` ` yaml
771
771
apiVersion: kubescheduler.config.k8s.io/v1beta2
@@ -792,7 +792,7 @@ as well as its seamless integration with the existing methods for configuring ex
792
792
* The scheduler plugin `ServiceAffinity` is deprecated; instead, use the [`InterPodAffinity`](/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity) plugin (enabled by default) to achieve similar behavior.
793
793
-->
794
794
* 调度程序插件 `ServiceAffinity` 已弃用;
795
- 相反,使用 [`InterPodAffinity`](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity)
795
+ 相反,使用 [`InterPodAffinity`](/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity)
796
796
插件(默认启用)来实现类似的行为。
797
797
798
798
<!--
@@ -825,6 +825,16 @@ as well as its seamless integration with the existing methods for configuring ex
825
825
* `NodeAffinity` 从 1 到 2
826
826
* `TaintToleration` 从 1 到 3
827
827
{{% /tab %}}
828
+
829
+ {{% tab name="v1beta3 → v1" %}}
830
+
831
+ <!--
832
+ * The scheduler plugin `SelectorSpread` is removed, instead, use the `PodTopologySpread` plugin (enabled by default)
833
+ to achieve similar behavior.
834
+ -->
835
+ * 调度器插件 `SelectorSpread` 被移除,改为使用 `PodTopologySpread` 插件(默认启用)来实现类似的行为。
836
+
837
+ {{% /tab %}}
828
838
{{< /tabs >}}
829
839
830
840
# # {{% heading "whatsnext" %}}
@@ -834,8 +844,10 @@ as well as its seamless integration with the existing methods for configuring ex
834
844
* Learn about [scheduling](/docs/concepts/scheduling-eviction/kube-scheduler/)
835
845
* Read the [kube-scheduler configuration (v1beta2)](/docs/reference/config-api/kube-scheduler-config.v1beta2/) reference
836
846
* Read the [kube-scheduler configuration (v1beta3)](/docs/reference/config-api/kube-scheduler-config.v1beta3/) reference
847
+ * Read the [kube-scheduler configuration (v1)](/docs/reference/config-api/kube-scheduler-config.v1/) reference
837
848
-->
838
849
* 阅读 [kube-scheduler 参考](/zh-cn/docs/reference/command-line-tools-reference/kube-scheduler/)
839
850
* 了解[调度](/zh-cn/docs/concepts/scheduling-eviction/kube-scheduler/)
840
851
* 阅读 [kube-scheduler 配置 (v1beta2)](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta2/) 参考
841
852
* 阅读 [kube-scheduler 配置 (v1beta3)](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta3/) 参考
853
+ * 阅读 [kube-scheduler 配置 (v1)](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1/) 参考
0 commit comments