Skip to content

Commit 766b048

Browse files
committed
[zh-cn] sync device-plugins.md and intro.md
Signed-off-by: xin.li <[email protected]>
1 parent 9764869 commit 766b048

File tree

2 files changed

+85
-20
lines changed

2 files changed

+85
-20
lines changed

content/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md

Lines changed: 82 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ to advertise that the node has 2 "Foo" devices installed and available.
7272
-->
7373
设备插件可以通过此 gRPC 服务在 kubelet 进行注册。在注册期间,设备插件需要发送下面几样内容:
7474

75-
* 设备插件的 Unix 套接字。
75+
* 设备插件的 UNIX 套接字。
7676
* 设备插件的 API 版本。
7777
* `ResourceName` 是需要公布的。这里 `ResourceName`
7878
需要遵循[扩展资源命名方案](/zh-cn/docs/concepts/configuration/manage-resources-containers/#extended-resources)
@@ -113,6 +113,15 @@ on certain nodes. Here is an example of a pod requesting this resource to run a
113113
假设 Kubernetes 集群正在运行一个设备插件,该插件在一些节点上公布的资源为 `hardware-vendor.example/foo`
114114
下面就是一个 Pod 示例,请求此资源以运行一个工作负载的示例:
115115

116+
<!--
117+
#
118+
# This Pod needs 2 of the hardware-vendor.example/foo devices
119+
# and can only schedule onto a Node that's able to satisfy
120+
# that need.
121+
#
122+
# If the Node has more than 2 of those devices available, the
123+
# remainder would be available for other Pods to use.
124+
-->
116125
```yaml
117126
---
118127
apiVersion: v1
@@ -127,7 +136,7 @@ spec:
127136
limits:
128137
hardware-vendor.example/foo: 2
129138
#
130-
# 这个 pod 需要两个 hardware-vendor.example/foo 设备
139+
# 这个 Pod 需要两个 hardware-vendor.example/foo 设备
131140
# 而且只能够调度到满足需求的节点上
132141
#
133142
# 如果该节点中有 2 个以上的设备可用,其余的可供其他 Pod 使用
@@ -281,12 +290,13 @@ The general workflow of a device plugin includes the following steps:
281290
The processing of the fully-qualified CDI device names by the Device Manager requires
282291
that the `DevicePluginCDIDevices` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
283292
is enabled for both the kubelet and the kube-apiserver. This was added as an alpha feature in Kubernetes
284-
v1.28 and graduated to beta in v1.29.
293+
v1.28, graduated to beta in v1.29 and to GA in v1.31.
285294
-->
286295
设备管理器处理完全限定的 CDI 设备名称时,
287296
需要为 kubelet 和 kube-apiserver 启用 `DevicePluginCDIDevices`
288297
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
289-
在 Kubernetes v1.28 版本中作为 Alpha 特性被加入,并在 v1.29 版本中升级为 Beta 特性。
298+
在 Kubernetes v1.28 版本中作为 Alpha 特性被加入,在 v1.29 版本中升级为 Beta 特性并在
299+
v1.31 版本升级为稳定可用特性。
290300
{{< /note >}}
291301

292302
<!--
@@ -300,8 +310,65 @@ of its Unix socket and re-register itself upon such an event.
300310
### 处理 kubelet 重启 {#handling-kubelet-restarts}
301311

302312
设备插件应能监测到 kubelet 重启,并且向新的 kubelet 实例来重新注册自己。
303-
新的 kubelet 实例启动时会删除 `/var/lib/kubelet/device-plugins` 下所有已经存在的 Unix 套接字。
304-
设备插件需要能够监控到它的 Unix 套接字被删除,并且当发生此类事件时重新注册自己。
313+
新的 kubelet 实例启动时会删除 `/var/lib/kubelet/device-plugins` 下所有已经存在的 UNIX 套接字。
314+
设备插件需要能够监控到它的 UNIX 套接字被删除,并且当发生此类事件时重新注册自己。
315+
316+
<!--
317+
### Device plugin and unhealthy devices
318+
319+
There are cases when devices fail or are shut down. The responsibility of the Device Plugin
320+
in this case is to notify the kubelet about the situation using the `ListAndWatchResponse` API.
321+
-->
322+
### 设备插件和不健康的设备
323+
324+
有时会发生设备出现故障或者被关闭的情况,这时,设备插件的职责是使用
325+
`ListAndWatch Response` API 将相关情况通报给 kubelet。
326+
327+
<!--
328+
Once a device is marked as unhealthy, the kubelet will decrease the allocatable count
329+
for this resource on the Node to reflect how many devices can be used for scheduling new pods.
330+
Capacity count for the resource will not change.
331+
-->
332+
一旦设备被标记为不健康,kubelet 将减少节点上此资源的可分配数量,
333+
以反映有多少设备可用于调度新的 Pod,资源的容量数量不会因此发生改变。
334+
335+
<!--
336+
Pods that were assigned to the failed devices will continue be assigned to this device.
337+
It is typical that code relying on the device will start failing and Pod may get
338+
into Failed phase if `restartPolicy` for the Pod was not `Always` or enter the crash loop
339+
otherwise.
340+
-->
341+
分配给故障设备的 Pod 将继续分配给该设备。
342+
通常情况下,依赖于设备的代码将开始失败,如果 Pod 的 `restartPolicy` 不是
343+
`Always`,则 Pod 可能会进入 Failed 阶段,否则会进入崩溃循环。
344+
345+
<!--
346+
Before Kubernetes v1.31, the way to know whether or not a Pod is associated with the
347+
failed device is to use the [PodResources API](#monitoring-device-plugin-resources).
348+
-->
349+
在 Kubernetes v1.31 之前,要知道 Pod 是否与故障设备关联,
350+
可以使用 [PodResources API](#monitoring-device-plugin-resources)
351+
352+
{{< feature-state feature_gate_name="ResourceHealthStatus" >}}
353+
354+
<!--
355+
By enabling the feature gate `ResourceHealthStatus`, the field `allocatedResourcesStatus`
356+
will be added to each container status, within the `.status` for each Pod. The `allocatedResourcesStatus`
357+
field
358+
reports health information for each device assigned to the container.
359+
-->
360+
通过启用特性门控 `ResourceHealthStatus`,系统将在每个 Pod 的
361+
`.status` 字段中的每个容器状态内添加 `allocatedResourcesStatus` 字段,
362+
`allocatedResourcesStatus` 字段报告分配给容器的每个设备的健康信息。
363+
364+
<!--
365+
For a failed Pod, or or where you suspect a fault, you can use this status to understand whether
366+
the Pod behavior may be associated with device failure. For example, if an accelerator is reporting
367+
an over-temperature event, the `allocatedResourcesStatus` field may be able to report this.
368+
-->
369+
对于发生故障的 Pod,或者你怀疑存在故障的情况,你可以使用此状态来了解
370+
Pod 行为是否可能与设备故障有关。例如,如果加速器报告过热事件,
371+
`allocatedResourcesStatus` 字段可能能够报告此情况。
305372

306373
<!--
307374
## Device plugin deployment
@@ -318,7 +385,7 @@ in the plugin's [PodSpec](/docs/reference/generated/kubernetes-api/{{< param "ve
318385
If you choose the DaemonSet approach you can rely on Kubernetes to: place the device plugin's
319386
Pod onto Nodes, to restart the daemon Pod after failure, and to help automate upgrades.
320387
-->
321-
## 设备插件部署 {#device-plugin-depoloyments}
388+
## 设备插件部署 {#device-plugin-deployment}
322389

323390
你可以将你的设备插件作为节点操作系统的软件包来部署、作为 DaemonSet 来部署或者手动部署。
324391

@@ -343,7 +410,7 @@ guaranteed to be non-breaking.
343410
-->
344411
## API 兼容性 {#api-compatibility}
345412

346-
之前版本控制方案要求设备插件的 API 版本与 Kubelet 的版本完全匹配。
413+
之前版本控制方案要求设备插件的 API 版本与 kubelet 的版本完全匹配。
347414
自从此特性在 v1.12 中进阶为 Beta 后,这不再是硬性要求。
348415
API 是版本化的,并且自此特性进阶 Beta 后一直表现稳定。
349416
因此,kubelet 升级应该是无缝的,但在稳定之前 API 仍然可能会有变更,还不能保证升级不会中断。
@@ -398,7 +465,7 @@ identifying containers using `pod`, `namespace`, and `container` prometheus labe
398465
为了监控设备插件提供的资源,监控代理程序需要能够发现节点上正在使用的设备,
399466
并获取元数据来描述哪个指标与容器相关联。
400467
设备监控代理暴露给 [Prometheus](https://prometheus.io/) 的指标应该遵循
401-
[Kubernetes Instrumentation Guidelines](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/instrumentation.md)
468+
[Kubernetes Instrumentation Guidelines(英文)](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/instrumentation.md)
402469
使用 `pod``namespace``container` 标签来标识容器。
403470

404471
<!--
@@ -605,7 +672,7 @@ below:
605672
3. Subtract out all of the CPUs from the `GetCpuIds` calls from the `GetAllocatableResources` call
606673
-->
607674
`List` 端点中的 `ContainerResources` 中的 cpu_ids 对应于分配给某个容器的专属 CPU。
608-
如果要统计共享池中的 CPU,`List` 端点需要与 `GetAllocatableResources` 端点一起使用,如下所述:
675+
如果要统计共享池中的 CPU,`List` 端点需要与 `GetAllocatableResources` 端点一起使用,如下所述
609676

610677
1. 调用 `GetAllocatableResources` 获取所有可用的 CPU。
611678
2. 在系统中所有的 `ContainerResources` 上调用 `GetCpuIds`
@@ -639,12 +706,12 @@ However, calling `GetAllocatableResources` endpoint is not sufficient in case of
639706
update and Kubelet needs to be restarted to reflect the correct resource capacity and allocatable.
640707
-->
641708
`GetAllocatableResources` 应该仅被用于评估一个节点上的[可分配的](/zh-cn/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable)资源。
642-
如果目标是评估空闲/未分配的资源,此调用应该与 List() 端点一起使用。
709+
如果目标是评估空闲/未分配的资源,此调用应该与 `List()` 端点一起使用。
643710
除非暴露给 kubelet 的底层资源发生变化,否则 `GetAllocatableResources` 得到的结果将保持不变。
644711
这种情况很少发生,但当发生时(例如:热插拔,设备健康状况改变),客户端应该调用 `GetAlloctableResources` 端点。
645712

646-
然而,调用 `GetAllocatableResources` 端点在 cpu、内存被更新的情况下是不够的,
647-
Kubelet 需要重新启动以获取正确的资源容量和可分配的资源。
713+
然而,调用 `GetAllocatableResources` 端点在 CPU、内存被更新的情况下是不够的,
714+
kubelet 需要重新启动以获取正确的资源容量和可分配的资源。
648715
{{< /note >}}
649716

650717
```gRPC
@@ -778,7 +845,7 @@ The Topology Manager is a Kubelet component that allows resources to be co-ordin
778845
aligned manner. In order to do this, the Device Plugin API was extended to include a
779846
`TopologyInfo` struct.
780847
-->
781-
拓扑管理器是 Kubelet 的一个组件,它允许以拓扑对齐方式来调度资源。
848+
拓扑管理器是 kubelet 的一个组件,它允许以拓扑对齐方式来调度资源。
782849
为了做到这一点,设备插件 API 进行了扩展来包括一个 `TopologyInfo` 结构体。
783850

784851
```gRPC
@@ -851,7 +918,7 @@ Here are some examples of device plugin implementations:
851918
* 适用于通用 Linux 设备和 USB 设备的[通用设备插件](https://github.com/squat/generic-device-plugin)
852919
* [Intel 设备插件](https://github.com/intel/intel-device-plugins-for-kubernetes)支持
853920
Intel GPU、FPGA、QAT、VPU、SGX、DSA、DLB 和 IAA 设备
854-
* [KubeVirt 设备插件](https://github.com/kubevirt/kubernetes-device-plugins) 用于硬件辅助的虚拟化
921+
* [KubeVirt 设备插件](https://github.com/kubevirt/kubernetes-device-plugins)用于硬件辅助的虚拟化
855922
* [为 Container-Optimized OS 所提供的 NVIDIA GPU 设备插件](https://github.com/GoogleCloudPlatform/container-engine-accelerators/tree/master/cmd/nvidia_gpu)
856923
* [RDMA 设备插件](https://github.com/hustcat/k8s-rdma-device-plugin)
857924
* [SocketCAN 设备插件](https://github.com/collabora/k8s-socketcan)

content/zh-cn/docs/concepts/windows/intro.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,25 +270,23 @@ Some kubelet command line options behave differently on Windows, as described be
270270
* The `--kube-reserved`, `--system-reserved` , and `--eviction-hard` flags update
271271
[NodeAllocatable](/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable)
272272
* Eviction by using `--enforce-node-allocable` is not implemented
273-
* Eviction by using `--eviction-hard` and `--eviction-soft` are not implemented
274273
* When running on a Windows node the kubelet does not have memory or CPU
275274
restrictions. `--kube-reserved` and `--system-reserved` only subtract from `NodeAllocatable`
276275
and do not guarantee resource provided for workloads.
277276
See [Resource Management for Windows nodes](/docs/concepts/configuration/windows-resource-management/#resource-reservation)
278277
for more information.
279-
* The `MemoryPressure` Condition is not implemented
278+
* The `PIDPressure` Condition is not implemented
280279
* The kubelet does not take OOM eviction actions
281280
-->
282281
* `--windows-priorityclass` 允许你设置 kubelet 进程的调度优先级
283282
(参考 [CPU 资源管理](/zh-cn/docs/concepts/configuration/windows-resource-management/#resource-management-cpu))。
284283
* `--kube-reserved``--system-reserved``--eviction-hard` 标志更新
285284
[NodeAllocatable](/zh-cn/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable)
286285
* 未实现使用 `--enforce-node-allocable` 驱逐。
287-
* 未实现使用 `--eviction-hard``--eviction-soft` 驱逐。
288286
* 在 Windows 节点上运行时,kubelet 没有内存或 CPU 限制。
289287
`--kube-reserved``--system-reserved` 仅从 `NodeAllocatable` 中减去,并且不保证为工作负载提供的资源。
290288
有关更多信息,请参考 [Windows 节点的资源管理](/zh-cn/docs/concepts/configuration/windows-resource-management/#resource-reservation)
291-
* 未实现 `MemoryPressure` 条件。
289+
* 未实现 `PIDPressure` 条件。
292290
* kubelet 不会执行 OOM 驱逐操作。
293291

294292
<!--
@@ -787,7 +785,7 @@ To set up the project on a newly created cluster, refer to the instructions in t
787785

788786
### 验证 Windows 集群的操作性 {#validating-windows-cluster-operability}
789787

790-
Kubernetes 项目提供了 **Windows 操作准备** 规范,配备了结构化的测试套件。
788+
Kubernetes 项目提供了 **Windows 操作准备**规范,配备了结构化的测试套件。
791789
这个套件分为两组测试:核心和扩展。每组测试都包含了针对特定场景的分类测试。
792790
它可以用来验证 Windows 和混合系统(混合了 Linux 节点)的所有功能,实现全面覆盖。
793791

0 commit comments

Comments
 (0)