diff --git a/k8s/lib.sh b/k8s/lib.sh index e3b871cfb..e3de17aa2 100755 --- a/k8s/lib.sh +++ b/k8s/lib.sh @@ -71,6 +71,11 @@ k8s::remove::containers() { # umount lingering volumes by force, to prevent potential volume leaks. cat /proc/mounts | grep /run/containerd/io.containerd. | cut -f2 -d' ' | xargs -r -t umount -f || true cat /proc/mounts | grep /var/lib/kubelet/pods | cut -f2 -d' ' | xargs -r -t umount -f || true + + # remove kubelet plugin sockets, as we don't have the containers associated with them anymore, + # so kubelet won't try to access inexistent plugins on reinstallation. + find /var/lib/kubelet/plugins/ -name "*.sock" | xargs rm -f || true + rm /var/lib/kubelet/plugins_registry/*.sock || true } # Run a ctr command against the local containerd socket