Skip to content

Commit 36c8de6

Browse files
committed
sync cpu-management-policies custom-resource-definitions scheduling-gpus
Update cpu-management-policies.md Update cpu-management-policies.md u
1 parent 4d66f8b commit 36c8de6

File tree

3 files changed

+50
-11
lines changed

3 files changed

+50
-11
lines changed

content/zh-cn/docs/tasks/administer-cluster/cpu-management-policies.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ The following policy options exist for the static `CPUManager` policy:
419419
* `full-pcpus-only` (beta, visible by default) (1.22 or higher)
420420
* `distribute-cpus-across-numa` (alpha, hidden by default) (1.23 or higher)
421421
* `align-by-socket` (alpha, hidden by default) (1.25 or higher)
422+
* `distribute-cpus-across-cores` (alpha, hidden by default) (1.31 or higher)
422423
-->
423424
#### Static 策略选项
424425

@@ -429,8 +430,9 @@ The following policy options exist for the static `CPUManager` policy:
429430

430431
静态 `CPUManager` 策略存在以下策略选项:
431432
* `full-pcpus-only`(Beta,默认可见)(1.22 或更高版本)
432-
* `distribute-cpus-across-numa`(alpha,默认隐藏)(1.23 或更高版本)
433+
* `distribute-cpus-across-numa`(Alpha,默认隐藏)(1.23 或更高版本)
433434
* `align-by-socket`(Alpha,默认隐藏)(1.25 或更高版本)
435+
* `distribute-cpus-across-cores` (Alpha,默认隐藏) (1.31 或更高版本)
434436

435437
<!--
436438
If the `full-pcpus-only` policy option is specified, the static policy will always allocate full physical cores.
@@ -499,6 +501,29 @@ than number of NUMA nodes.
499501
通过指示 `CPUManager` 在 CPU 的插槽边界而不是 NUMA 边界显式对齐 CPU,我们能够避免此类问题。
500502
注意,此策略选项不兼容 `TopologyManager` 与 `single-numa-node` 策略,并且不适用于 CPU 的插槽数量大于 NUMA 节点数量的硬件。
501503

504+
<!--
505+
If the `distribute-cpus-across-cores` policy option is specified, the static policy
506+
will attempt to allocate virtual cores (hardware threads) across different physical cores.
507+
By default, the `CPUManager` tends to pack cpus onto as few physical cores as possible,
508+
which can lead to contention among cpus on the same physical core and result
509+
in performance bottlenecks. By enabling the `distribute-cpus-across-cores` policy,
510+
the static policy ensures that cpus are distributed across as many physical cores
511+
as possible, reducing the contention on the same physical core and thereby
512+
improving overall performance. However, it is important to note that this strategy
513+
might be less effective when the system is heavily loaded. Under such conditions,
514+
the benefit of reducing contention diminishes. Conversely, default behavior
515+
can help in reducing inter-core communication overhead, potentially providing
516+
better performance under high load conditions.
517+
-->
518+
如果指定了 `distribute-cpus-across-cores` 策略选项,
519+
静态策略将尝试将虚拟核(硬件线程)分配到不同的物理核上。默认情况下,
520+
`CPUManager` 倾向于将 CPU 打包到尽可能少的物理核上,
521+
这可能导致同一物理核上的 CPU 争用,从而导致性能瓶颈。
522+
启用 `distribute-cpus-across-cores` 策略后,静态策略将确保 CPU 尽可能分布在多个物理核上,
523+
从而减少同一物理核上的争用,提升整体性能。然而,需要注意的是,当系统负载较重时,
524+
这一策略的效果可能会减弱。在这种情况下,减少争用的好处会减少。
525+
相反,默认行为可以帮助减少跨核的通信开销,在高负载条件下可能会提供更好的性能。
526+
502527
<!--
503528
The `full-pcpus-only` option can be enabled by adding `full-pcpus-only=true` to
504529
the CPUManager policy options.
@@ -517,3 +542,12 @@ and `distribute-cpus-across-numa` policy options.
517542
可以通过将 `align-by-socket=true` 添加到 `CPUManager` 策略选项来启用 `align-by-socket` 策略选项。
518543
同样,也能够将 `distribute-cpus-across-numa=true` 添加到 `full-pcpus-only`
519544
和 `distribute-cpus-across-numa` 策略选项中。
545+
546+
<!--
547+
The `distribute-cpus-across-cores` option can be enabled by adding
548+
`distribute-cpus-across-cores=true` to the `CPUManager` policy options.
549+
It cannot be used with `full-pcpus-only` or `distribute-cpus-across-numa` policy
550+
options together at this moment.
551+
-->
552+
可以通过将 `distribute-cpus-across-cores=true` 添加到 `CPUManager` 策略选项中来启用 `distribute-cpus-across-cores` 选项。
553+
当前,该选项不能与 `full-pcpus-only` 或 `distribute-cpus-across-numa` 策略选项同时使用。

content/zh-cn/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,24 +2732,29 @@ may also be used with field selectors when included in the `spec.versions[*].sel
27322732
{{< feature-state feature_gate_name="CustomResourceFieldSelectors" >}}
27332733
27342734
<!--
2735-
You need to enable the `CustomResourceFieldSelectors`
2736-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to
2737-
use this behavior, which then applies to all CustomResourceDefinitions in your
2738-
cluster.
2735+
For Kubernetes {{< skew currentVersion >}} the ability to define field selectors for
2736+
custom resources is available by default (enabled by default since Kubernetes v1.31);
2737+
you can disable it for your cluster by turning off the `CustomResourceFieldSelectors`
2738+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
27392739
27402740
The `spec.versions[*].selectableFields` field of a {{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinition" >}} may be used to
2741-
declare which other fields in a custom resource may be used in field selectors.
2741+
declare which other fields in a custom resource may be used in field selectors
2742+
with the feature of `CustomResourceFieldSelectors`
2743+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) (This feature gate is enabled by default since Kubernetes v1.31).
27422744
The following example adds the `.spec.color` and `.spec.size` fields as
27432745
selectable fields.
27442746
27452747
Save the CustomResourceDefinition to `shirt-resource-definition.yaml`:
27462748
-->
2747-
你需要启用 `CustomResourceFieldSelectors`
2748-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
2749-
才能使用此行为,然后该行为将应用于集群中的所有 CustomResourceDefinition。
2749+
在 Kubernetes {{< skew currentVersion >}} 中,
2750+
自定义资源的字段选择器功能默认启用(自 Kubernetes v1.31 起默认开启)。
2751+
如果你想禁用此功能,可以通过关闭 `CustomResourceFieldSelectors`
2752+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) 实现。
27502753
27512754
CustomResourceDefinition 的 `spec.versions[*].selectableFields`
27522755
字段可用于声明自定义资源中的哪些其他字段可在字段选择器中使用。
2756+
这一功能依赖于 `CustomResourceFieldSelectors`
2757+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)(自 Kubernetes v1.31 起默认启用)。
27532758
以下示例将 `.spec.color` 和 `.spec.size` 字段添加为可选字段。
27542759
27552760
将 CustomResourceDefinition 保存到 `shirt-resource-definition.yaml`:

content/zh-cn/docs/tasks/manage-gpus/scheduling-gpus.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ spec:
224224
#### GPU vendor implementations
225225
226226
- [Intel](https://intel.github.io/intel-device-plugins-for-kubernetes/cmd/gpu_plugin/README.html)
227-
- [NVIDIA](https://github.com/NVIDIA/gpu-feature-discovery/#readme)
227+
- [NVIDIA](https://github.com/NVIDIA/k8s-device-plugin)
228228
-->
229229
#### GPU 供应商实现
230230

231231
- [Intel](https://intel.github.io/intel-device-plugins-for-kubernetes/cmd/gpu_plugin/README.html)
232-
- [NVIDIA](https://github.com/NVIDIA/gpu-feature-discovery/#readme)
232+
- [NVIDIA](https://github.com/NVIDIA/k8s-device-plugin)

0 commit comments

Comments
 (0)