canonical / k8s-snap

Canonical Kubernetes is an opinionated and CNCF conformant Kubernetes operated by Snaps and Charms, which come together to bring simplified operations and an enhanced security posture on any infrastructure.
GNU General Public License v3.0
43 stars 13 forks source link

Forces volume umount when snap is removed #613

Closed claudiubelu closed 2 months ago

claudiubelu commented 3 months ago

Some Kubernetes volumes may not be easily removed (e.g.: NFS volumes from a local NFS provider), leading to a significantly increased snap removal time and leaked volume mounts.

Due to the volume leak, the /var/lib/kubelet folder is never cleaned up properly either, which means that on reinstalling the k8s snap afterwards and bootstrapping the cluster, the current node will not be registered to the cluster.

This adds the -f option to umount, forcing the unmount.

Fixes: https://github.com/canonical/k8s-snap/issues/612

bschimke95 commented 2 months ago

Thanks @claudiubelu!