Microk8s: How to prune snapshots with containerd?

Created on 24 May 2019  路  4Comments  路  Source: ubuntu/microk8s

Since the switch to containerd the containerd snapshot folder grows on my host:

/var/snap/microk8s/common/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/...

Now there there are no inodes and space left on the host. With docker I used to regulary prune old stuff. But how can I cleanup this artifacts with containerd / ctr?

Thanks in advance!

Hannes

Most helpful comment

Any idea where I can configure this in microk8s/kubelet?

You can edit /var/snap/microk8s/current/args/kubelet to add the arguments you please and then do a microk8s.stop, microk8s.start cycle.

All 4 comments

Hi @toxsick I do not have a good answer (for now) but here is what i know. We can see the running containers with:

microk8s.ctr -n k8s.io containers ls

We can then remove images with:

microk8s.ctr -n k8s.io images rm --sync "image_ref"

Also kubelet should be garbage collecting unused images: https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/

Hi @ktsakalozos

thanks for your answer! I saw that, but there does not seam to be something easy right? I would like to lower the image-gc-high-threshold to something like 60%. Any idea where I can configure this in microk8s/kubelet?

Any idea where I can configure this in microk8s/kubelet?

You can edit /var/snap/microk8s/current/args/kubelet to add the arguments you please and then do a microk8s.stop, microk8s.start cycle.

Ohh that helps! Thanks!

Was this page helpful?
0 / 5 - 0 ratings