1

I have a K3s single-node cluster running with Containerd and where I'm reaching the space disk limit.

It seems I have some old unused docker images on the machine.

How can I cleanup those in order to free up the disk ?

Thanks

EDIT

After further investigation it seems it's more a volume (or several) from running container that is taking all the disk space.

How can I list the volumes used by the pods and their properties (disk etc..)

iAmoric
  • 121
  • 4

1 Answers1

1

About the docker images

As mentioned in docker documentation

You can use docker image ls to list all images and docker rmi to delete them.

For example you can use

docker rmi -f $(docker images -a -q)

To delete all the images


About disk space

You could try with df, du and kubectl top/describe commands.

df -h
du -sh . 
kubectl top/describe

You can list all Persistent Volumes and Persistent Volumes Claims with:

kubectl get pv --all-namespaces
kubectl get pvc --all-namespaces

You can list all Persistent Volumes sorted by capacity

kubectl get pv --sort-by=.spec.capacity.storage --all-namespaces

Additionally look at these


Hope you find this useful.

Jakub
  • 365
  • 1
  • 9