Skip to content

Commit 4ab70ee

Browse files
committed
[zh-cn] imporve device-plugins.md
Signed-off-by: xin.li <[email protected]>
1 parent 67ec330 commit 4ab70ee

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ other resources, with the following differences:
8686
* Devices cannot be shared between containers.
8787
-->
8888
然后,用户可以请求设备作为 Pod 规范的一部分,
89-
参见[Container](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container)
89+
参见 [Container](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#Container)
9090
请求扩展资源类似于管理请求和限制的方式,
9191
其他资源,有以下区别:
9292

@@ -334,7 +334,7 @@ kubelet 提供了 gRPC 服务来使得正在使用中的设备被发现,并且
334334

335335
```gRPC
336336
// PodResourcesLister 是一个由 kubelet 提供的服务,用来提供供节点上
337-
// Pods 和容器使用的节点资源的信息
337+
// Pod 和容器使用的节点资源的信息
338338
service PodResourcesLister {
339339
rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {}
340340
rpc GetAllocatableResources(AllocatableResourcesRequest) returns (AllocatableResourcesResponse) {}
@@ -349,7 +349,7 @@ id of exclusively allocated CPUs, device id as it was reported by device plugins
349349
the NUMA node where these devices are allocated. Also, for NUMA-based machines, it contains
350350
the information about memory and hugepages reserved for a container.
351351
-->
352-
这一 `List` 端点提供运行中 Pods 的资源信息,包括类似独占式分配的
352+
这一 `List` 端点提供运行中 Pod 的资源信息,包括类似独占式分配的
353353
CPU ID、设备插件所报告的设备 ID 以及这些设备分配所处的 NUMA 节点 ID。
354354
此外,对于基于 NUMA 的机器,它还会包含为容器保留的内存和大页的信息。
355355

@@ -414,7 +414,7 @@ below:
414414
`List` 端点中的 `ContainerResources` 中的 cpu_ids 对应于分配给某个容器的专属 CPU。
415415
如果要统计共享池中的 CPU,`List` 端点需要与 `GetAllocatableResources` 端点一起使用,如下所述:
416416

417-
1. 调用 `GetAllocatableResources` 获取所有可用的 CPUs
417+
1. 调用 `GetAllocatableResources` 获取所有可用的 CPU
418418
2. 在系统中所有的 `ContainerResources` 上调用 `GetCpuIds`
419419
3.`GetAllocatableResources` 获取的 CPU 数减去 `GetCpuIds` 获取的 CPU 数。
420420
{{< /note >}}
@@ -441,9 +441,9 @@ it does (for example: hotplug/hotunplug, device health changes), client is expec
441441
However, calling `GetAllocatableResources` endpoint is not sufficient in case of cpu and/or memory
442442
update and Kubelet needs to be restarted to reflect the correct resource capacity and allocatable.
443443
-->
444-
`GetAllocatableResources` 应该仅被用于评估一个节点上的[可分配的](/zh-cn/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable)
445-
资源。如果目标是评估空闲/未分配的资源,此调用应该与 List() 端点一起使用。
446-
除非暴露给 kubelet 的底层资源发生变化 否则 `GetAllocatableResources` 得到的结果将保持不变。
444+
`GetAllocatableResources` 应该仅被用于评估一个节点上的[可分配的](/zh-cn/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable)资源。
445+
如果目标是评估空闲/未分配的资源,此调用应该与 List() 端点一起使用。
446+
除非暴露给 kubelet 的底层资源发生变化否则 `GetAllocatableResources` 得到的结果将保持不变。
447447
这种情况很少发生,但当发生时(例如:热插拔,设备健康状况改变),客户端应该调用 `GetAlloctableResources` 端点。
448448
然而,调用 `GetAllocatableResources` 端点在 cpu、内存被更新的情况下是不够的,
449449
Kubelet 需要重新启动以获取正确的资源容量和可分配的资源。
@@ -471,7 +471,7 @@ Preceding Kubernetes v1.23, to enable this feature `kubelet` must be started wit
471471
-->
472472
从 Kubernetes v1.23 开始,`GetAllocatableResources` 被默认启用。
473473
你可以通过关闭 `KubeletPodResourcesGetAllocatable`
474-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) 来禁用。
474+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)来禁用。
475475

476476
在 Kubernetes v1.23 之前,要启用这一功能,`kubelet` 必须用以下标志启动:
477477

@@ -508,7 +508,7 @@ gRPC 服务通过 `/var/lib/kubelet/pod-resources/kubelet.sock` 的 UNIX 套接
508508
中声明将 `/var/lib/kubelet/pod-resources` 目录以
509509
{{< glossary_tooltip text="卷" term_id="volume" >}}的形式被挂载到设备监控代理中。
510510

511-
对“PodResourcesLister 服务”的支持要求启用 `KubeletPodResources`
511+
“PodResourcesLister 服务”的支持要求启用 `KubeletPodResources`
512512
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
513513
从 Kubernetes 1.15 开始默认启用,自从 Kubernetes 1.20 开始为 v1。
514514

0 commit comments

Comments
 (0)