Skip to content

Commit 00f09ea

Browse files
authored
Merge pull request #42339 from SergeyKanzhelev/kubeletRestart
added a note about mounting pod-resources instead of kubelet.sock
2 parents 21b836a + e803bbe commit 00f09ea

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,28 @@ DaemonSet, `/var/lib/kubelet/pod-resources` must be mounted as a
361361
{{< glossary_tooltip term_id="volume" >}} in the device monitoring agent's
362362
[PodSpec](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podspec-v1-core).
363363

364+
{{< note >}}
365+
366+
When accessing the `/var/lib/kubelet/pod-resources/kubelet.sock` from DaemonSet
367+
or any other app deployed as a container on the host, which is mounting socket as
368+
a volume, it is a good practice to mount directory `/var/lib/kubelet/pod-resources/`
369+
instead of the `/var/lib/kubelet/pod-resources/kubelet.sock`. This will ensure
370+
that after kubelet restart, container will be able to re-connect to this socket.
371+
372+
Container mounts are managed by inode referencing the socket or directory,
373+
depending on what was mounted. When kubelet restarts, socket is deleted
374+
and a new socket is created, while directory stays untouched.
375+
So the original inode for the socket become unusable. Inode to directory
376+
will continue working.
377+
378+
{{< /note >}}
379+
364380
Support for the `PodResourcesLister service` requires `KubeletPodResources`
365381
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled.
366382
It is enabled by default starting with Kubernetes 1.15 and is v1 since Kubernetes 1.20.
367383

384+
385+
368386
### `Get` gRPC endpoint {#grpc-endpoint-get}
369387

370388
{{< feature-state state="alpha" for_k8s_version="v1.27" >}}

0 commit comments

Comments
 (0)