kubelet dies saying: failed to get device for dir "/var/lib/kubelet": could not find device ... in cached partitions map
This error happens when the filesystem of /var/lib/kubelet
is tmpfs
.
kubelet uses /var/lib/kubelet
directory to prepare Pod volumes and local ephemeral storages.
To limit and request usage of local ephemeral storages, kubelet has a feature gate called LocalStorageCapacityIsolation
. When LocalStorageCapacityIsolation
is enabled (default since Kubernetes 1.10), kubelet tries to identify the underlying block device of /var/lib/kubelet
. If tmpfs
is used for /var/lib/kubelet
, kubelet dies because there is no underlying block device.
You have several options to workaround the problem:
-
Use filesystem other than
tmpfs
. -
Specify another directory by
--root-dir
option. -
Disable the feature gate by adding the following
extra_args
to kubelet.--feature-gates=LocalStorageCapacityIsolation=disable