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
40
stars
11
forks
source link
K8s snap leaks NFS volume mounts after removal #612
If a local NFS CSI provider is used, and the k8s snap is removed afterwards, it may leak any NFS volume mounts, and also increase the snap removal time significantly.
Not only that, due to the volume leak, the /var/lib/kubelet folder is never cleaned up properly either, which means that on reinstalling and bootstrapping the cluster, the current node will not be registered to the new cluster.
What Should Happen Instead?
Volumes should not be leaked and the /var/lib/kubelet folder should be cleaned up on snap removal.
Summary
If a local NFS CSI provider is used, and the k8s snap is removed afterwards, it may leak any NFS volume mounts, and also increase the snap removal time significantly.
Not only that, due to the volume leak, the
/var/lib/kubelet
folder is never cleaned up properly either, which means that on reinstalling and bootstrapping the cluster, the current node will not be registered to the new cluster.What Should Happen Instead?
Volumes should not be leaked and the
/var/lib/kubelet
folder should be cleaned up on snap removal.Reproduction Steps
sudo snap install k8s --channel=1.30-classic/beta --classic
cat /proc/mounts | grep kubelet
Alternatively, the following can be run instead to replicate the issue:
System information
N/A
Can you suggest a fix?
-f
and-l
can be added to theumount
commands, resolving the issue.Are you interested in contributing with a fix?
Yes