Skip to content

Commit 649eb46

Browse files
authored
Merge pull request #36373 from windsonsea/configy
[zh] Sync1.25 /reference/scheduling/config.md
2 parents 79b608f + fa09be3 commit 649eb46

File tree

1 file changed

+58
-46
lines changed
  • content/zh-cn/docs/reference/scheduling

1 file changed

+58
-46
lines changed

content/zh-cn/docs/reference/scheduling/config.md

Lines changed: 58 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: Scheduler Configuration
88
content_type: concept
99
weight: 20
1010
-->
11-
{{< feature-state for_k8s_version="v1.19" state="beta" >}}
11+
{{< feature-state for_k8s_version="v1.25" state="stable" >}}
1212

1313
<!--
1414
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.
3030

3131
<!--
3232
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/))
3636
struct.
3737
-->
3838
你可以通过运行 `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/))结构体。
4141

4242
<!--
4343
A minimal configuration looks as follows:
4444
-->
4545
最简单的配置如下:
4646

4747
```yaml
48-
apiVersion: kubescheduler.config.k8s.io/v1beta2
48+
apiVersion: kubescheduler.config.k8s.io/v1
4949
kind: KubeSchedulerConfiguration
5050
clientConnection:
5151
kubeconfig: /etc/srv/kubernetes/kube-scheduler/kubeconfig
5252
```
5353
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+
5466
<!--
5567
## Profiles
5668
-->
@@ -153,7 +165,7 @@ extension points:
153165
-->
154166
11. `postBind`:这是一个信息扩展点,在 Pod 绑定了节点之后调用。
155167
<!--
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
157169
or disabled for all of their applicable extension points simultaneously.
158170
-->
159171
12. `multiPoint`:这是一个仅配置字段,允许同时为所有适用的扩展点启用或禁用插件。
@@ -165,7 +177,7 @@ or enable your own. For example:
165177
对每个扩展点,你可以禁用[默认插件](#scheduling-plugins)或者是启用自己的插件,例如:
166178

167179
```yaml
168-
apiVersion: kubescheduler.config.k8s.io/v1beta2
180+
apiVersion: kubescheduler.config.k8s.io/v1
169181
kind: KubeSchedulerConfiguration
170182
profiles:
171183
- plugins:
@@ -391,20 +403,6 @@ that are not enabled by default:
391403
-->
392404
你也可以通过组件配置 API 启用以下插件(默认不启用):
393405

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-
408406
<!--
409407
- `CinderLimits`: Checks that [OpenStack Cinder](https://docs.openstack.org/cinder/)
410408
volume limits can be satisfied for the node.
@@ -433,7 +431,7 @@ disabled.
433431
使用下面的配置样例,调度器将运行两个配置文件:一个使用默认插件,另一个禁用所有打分插件。
434432

435433
```yaml
436-
apiVersion: kubescheduler.config.k8s.io/v1beta2
434+
apiVersion: kubescheduler.config.k8s.io/v1
437435
kind: KubeSchedulerConfiguration
438436
profiles:
439437
- schedulerName: default-scheduler
@@ -513,7 +511,7 @@ points, the profile config looks like:
513511
要为其所有可用的扩展点启用 `MyPlugin`,配置文件配置如下所示:
514512

515513
```yaml
516-
apiVersion: kubescheduler.config.k8s.io/v1beta3
514+
apiVersion: kubescheduler.config.k8s.io/v1
517515
kind: KubeSchedulerConfiguration
518516
profiles:
519517
- schedulerName: multipoint-scheduler
@@ -530,7 +528,7 @@ points, like so:
530528
这相当于为所有扩展点手动启用 `MyPlugin`,如下所示:
531529

532530
```yaml
533-
apiVersion: kubescheduler.config.k8s.io/v1beta3
531+
apiVersion: kubescheduler.config.k8s.io/v1
534532
kind: KubeSchedulerConfiguration
535533
profiles:
536534
- schedulerName: non-multipoint-scheduler
@@ -562,12 +560,12 @@ the `disabled` field for that extension point. This works with disabling default
562560
plugins, non-default plugins, or with the wildcard (`'*'`) to disable all plugins.
563561
An example of this, disabling `Score` and `PreScore`, would be:
564562
-->
565-
可以使用该扩展点的 `disabled` 字段将特定扩展点从 `MultiPoint` 扩展中排除。
566-
这适用于禁用默认插件、非默认插件或使用通配符 (`'*'`) 来禁用所有插件。
563+
可以使用该扩展点的 `disabled` 字段将特定扩展点从 `MultiPoint` 扩展中排除。
564+
这适用于禁用默认插件、非默认插件或使用通配符 (`'*'`) 来禁用所有插件。
567565
禁用 `Score` 和 `PreScore` 的一个例子是:
568566

569567
```yaml
570-
apiVersion: kubescheduler.config.k8s.io/v1beta3
568+
apiVersion: kubescheduler.config.k8s.io/v1
571569
kind: KubeSchedulerConfiguration
572570
profiles:
573571
- schedulerName: non-multipoint-scheduler
@@ -584,19 +582,20 @@ profiles:
584582
```
585583

586584
<!--
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`.
588587
However, individual extension points are still available to allow flexible
589588
reconfiguration of the default values (such as ordering and Score weights). For
590589
example, consider two Score plugins `DefaultScore1` and `DefaultScore2`, each with
591590
a weight of `1`. They can be reordered with different weights like so:
592591
-->
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`
596595
它们可以用不同的权重重新排序,如下所示:
597596

598597
```yaml
599-
apiVersion: kubescheduler.config.k8s.io/v1beta3
598+
apiVersion: kubescheduler.config.k8s.io/v1
600599
kind: KubeSchedulerConfiguration
601600
profiles:
602601
- schedulerName: multipoint-scheduler
@@ -614,9 +613,9 @@ This is because plugins set through specific extension points will always take p
614613
over `MultiPoint` plugins. So, this snippet essentially re-orders the two plugins
615614
without needing to specify both of them.
616615
-->
617-
在这个例子中,没有必要在 `MultiPoint` 中明确指定插件,因为它们是默认插件。
618-
`Score` 中指定的唯一插件是 `DefaultScore2`。
619-
这是因为通过特定扩展点设置的插件将始终优先于 `MultiPoint` 插件。
616+
在这个例子中,没有必要在 `MultiPoint` 中明确指定插件,因为它们是默认插件。
617+
`Score` 中指定的唯一插件是 `DefaultScore2`。
618+
这是因为通过特定扩展点设置的插件将始终优先于 `MultiPoint` 插件。
620619
因此,此代码段实质上重新排序了这两个插件,而无需同时指定它们。
621620

622621
<!--
@@ -658,7 +657,7 @@ A valid sample configuration for these plugins would be:
658657
这些插件的一个有效示例配置是:
659658

660659
```yaml
661-
apiVersion: kubescheduler.config.k8s.io/v1beta3
660+
apiVersion: kubescheduler.config.k8s.io/v1
662661
kind: KubeSchedulerConfiguration
663662
profiles:
664663
- schedulerName: multipoint-scheduler
@@ -684,7 +683,7 @@ Note that there is no error for re-declaring a `MultiPoint` plugin in a specific
684683
extension point. The re-declaration is ignored (and logged), as specific extension points
685684
take precedence.
686685
-->
687-
请注意,在特定扩展点中重新声明 `MultiPoint` 插件不会出错。
686+
请注意,在特定扩展点中重新声明 `MultiPoint` 插件不会出错。
688687
重新声明被忽略(并记录),因为特定的扩展点优先。
689688

690689
<!--
@@ -715,14 +714,14 @@ profiles:
715714
- schedulerName: multipoint-scheduler
716715
plugins:
717716
718-
# Disable the default QueueSort plugin
717+
# 禁用默认的 QueueSort 插件
719718
queueSort:
720719
enabled:
721720
- name: 'CustomQueueSort'
722721
disabled:
723722
- name: 'DefaultQueueSort'
724723
725-
# Enable custom Filter plugins
724+
# 启用自定义的 Filter 插件
726725
filter:
727726
enabled:
728727
- name: 'CustomPlugin1'
@@ -731,7 +730,7 @@ profiles:
731730
disabled:
732731
- name: 'DefaultPlugin1'
733732
734-
# Enable and reorder custom score plugins
733+
# 启用并重新排序自定义的打分插件
735734
score:
736735
enabled:
737736
- name: 'DefaultPlugin2'
@@ -750,6 +749,7 @@ as well as its seamless integration with the existing methods for configuring ex
750749
## Scheduler configuration migrations
751750
-->
752751
## 调度程序配置迁移 {#scheduler-configuration-migrations}
752+
753753
{{< tabs name="tab_with_md" >}}
754754
{{% tab name="v1beta1 → v1beta2" %}}
755755

@@ -763,9 +763,9 @@ as well as its seamless integration with the existing methods for configuring ex
763763
with a `scoreStrategy` that is similar to:
764764
-->
765765
* 在 v1beta2 配置版本中,你可以为 `NodeResourcesFit` 插件使用新的 score 扩展。
766-
新的扩展结合了 `NodeResourcesLeastAllocated`、`NodeResourcesMostAllocated` 和 `RequestedToCapacityRatio` 插件的功能。
767-
例如,如果你之前使用了 `NodeResourcesMostAllocated` 插件,
768-
则可以改用 `NodeResourcesFit`(默认启用)并添加一个 `pluginConfig` 和 `scoreStrategy`,类似于:
766+
新的扩展结合了 `NodeResourcesLeastAllocated`、`NodeResourcesMostAllocated` 和 `RequestedToCapacityRatio` 插件的功能。
767+
例如,如果你之前使用了 `NodeResourcesMostAllocated` 插件,
768+
则可以改用 `NodeResourcesFit`(默认启用)并添加一个 `pluginConfig` 和 `scoreStrategy`,类似于:
769769

770770
```yaml
771771
apiVersion: kubescheduler.config.k8s.io/v1beta2
@@ -792,7 +792,7 @@ as well as its seamless integration with the existing methods for configuring ex
792792
* 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.
793793
-->
794794
* 调度程序插件 `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)
796796
插件(默认启用)来实现类似的行为。
797797

798798
<!--
@@ -825,6 +825,16 @@ as well as its seamless integration with the existing methods for configuring ex
825825
* `NodeAffinity` 从 1 到 2
826826
* `TaintToleration` 从 1 到 3
827827
{{% /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 %}}
828838
{{< /tabs >}}
829839

830840
## {{% heading "whatsnext" %}}
@@ -834,8 +844,10 @@ as well as its seamless integration with the existing methods for configuring ex
834844
* Learn about [scheduling](/docs/concepts/scheduling-eviction/kube-scheduler/)
835845
* Read the [kube-scheduler configuration (v1beta2)](/docs/reference/config-api/kube-scheduler-config.v1beta2/) reference
836846
* 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
837848
-->
838849
* 阅读 [kube-scheduler 参考](/zh-cn/docs/reference/command-line-tools-reference/kube-scheduler/)
839850
* 了解[调度](/zh-cn/docs/concepts/scheduling-eviction/kube-scheduler/)
840851
* 阅读 [kube-scheduler 配置 (v1beta2)](/zh-cn/docs/reference/config-api/kube-scheduler-config.v1beta2/) 参考
841852
* 阅读 [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

Comments
 (0)