Skip to content

Commit

Permalink
Removes lingering kubelet plugins on snap removal (#727)
Browse files Browse the repository at this point in the history
At the moment, the kubelet plugins in /var/lib/kubelet/plugins/ are not
removed, even though the Pods associated with those plugins have been
removed.

This means that on reinstallation, kubelet will try to access those
inexistent plugins through the *.sock files, including for plugins we
don't want anymore, and delaying registration for the ones we do want.
  • Loading branch information
claudiubelu authored Oct 11, 2024
1 parent 45b544f commit d57414c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions k8s/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d57414c

Please sign in to comment.