Skip to content

Commit c1295b9

Browse files
authored
[zh] sync /compute-storage-net/device-plugins.md (#42349)
1 parent 672f20e commit c1295b9

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

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

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ The general workflow of a device plugin includes the following steps:
230230
1. The plugin registers itself with the kubelet through the Unix socket at host
231231
path `/var/lib/kubelet/device-plugins/kubelet.sock`.
232232
-->
233-
3. 插件通过位于主机路径 `/var/lib/kubelet/device-plugins/kubelet.sock` 下的 UNIX 套接字
234-
kubelet 注册自身。
233+
3. 插件通过位于主机路径 `/var/lib/kubelet/device-plugins/kubelet.sock` 下的 UNIX
234+
套接字向 kubelet 注册自身。
235235

236236
{{< note >}}
237237
<!--
@@ -659,10 +659,6 @@ agents must run in a privileged security context. If a device monitoring agent i
659659
DaemonSet, `/var/lib/kubelet/pod-resources` must be mounted as a
660660
{{< glossary_tooltip term_id="volume" >}} in the device monitoring agent's
661661
[PodSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core).
662-
663-
Support for the `PodResourcesLister service` requires `KubeletPodResources`
664-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled.
665-
It is enabled by default starting with Kubernetes 1.15 and is v1 since Kubernetes 1.20.
666662
-->
667663
gRPC 服务通过 `/var/lib/kubelet/pod-resources/kubelet.sock` 的 UNIX 套接字来提供服务。
668664
设备插件资源的监控代理程序可以部署为守护进程或者 DaemonSet。
@@ -673,6 +669,39 @@ gRPC 服务通过 `/var/lib/kubelet/pod-resources/kubelet.sock` 的 UNIX 套接
673669
中声明将 `/var/lib/kubelet/pod-resources`
674670
目录以{{< glossary_tooltip text="卷" term_id="volume" >}}的形式被挂载到设备监控代理中。
675671

672+
{{< note >}}
673+
674+
<!--
675+
When accessing the `/var/lib/kubelet/pod-resources/kubelet.sock` from DaemonSet
676+
or any other app deployed as a container on the host, which is mounting socket as
677+
a volume, it is a good practice to mount directory `/var/lib/kubelet/pod-resources/`
678+
instead of the `/var/lib/kubelet/pod-resources/kubelet.sock`. This will ensure
679+
that after kubelet restart, container will be able to re-connect to this socket.
680+
-->
681+
在从 DaemonSet 或以容器形式部署在主机上的任何其他应用中访问
682+
`/var/lib/kubelet/pod-resources/kubelet.sock` 时,
683+
如果将套接字作为卷挂载,最好的做法是挂载目录 `/var/lib/kubelet/pod-resources/`
684+
而不是 `/var/lib/kubelet/pod-resources/kubelet.sock`
685+
这样可以确保在 kubelet 重新启动后,容器将能够重新连接到此套接字。
686+
687+
<!--
688+
Container mounts are managed by inode referencing the socket or directory,
689+
depending on what was mounted. When kubelet restarts, socket is deleted
690+
and a new socket is created, while directory stays untouched.
691+
So the original inode for the socket become unusable. Inode to directory
692+
will continue working.
693+
-->
694+
容器挂载是通过引用套接字或目录的 inode 进行管理的,具体取决于挂载的内容。
695+
当 kubelet 重新启动时,套接字会被删除并创建一个新的套接字,而目录则保持不变。
696+
因此,针对原始套接字的 inode 将变得无法使用,而到目录的 inode 将继续正常工作。
697+
698+
{{< /note >}}
699+
700+
<!--
701+
Support for the `PodResourcesLister service` requires `KubeletPodResources`
702+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled.
703+
It is enabled by default starting with Kubernetes 1.15 and is v1 since Kubernetes 1.20.
704+
-->
676705
对 “PodResourcesLister 服务”的支持要求启用 `KubeletPodResources`
677706
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
678707
从 Kubernetes 1.15 开始默认启用,自从 Kubernetes 1.20 开始为 v1。

0 commit comments

Comments
 (0)