https://rancher.com/ logo
Title
h

hundreds-evening-84071

03/27/2023, 2:09 PM
Hey folks, Question on cleaning up old unused images. Working on RKE2 v1.23.16+rke2r1 I came across this for k3s: https://github.com/k3s-io/k3s/issues/1900
sudo k3s crictl
images to see what images have been pulled locally
sudo k3s crictl rmi --prune
to delete any images no currently used by a running container
Is there something similar for RKE2?
b

bulky-sunset-52084

03/27/2023, 3:22 PM
yea in k3s crictl is bundled inside of of the k3s binary in rke2. it's split back out so you can run the crictl binary directly from
/var/lib/rancher/rke2/bin/
Also you shouldn't need to do Garbage Collection manually - https://kubernetes.io/docs/concepts/architecture/garbage-collection/#containers-images The kubelet should handle this for you
h

hundreds-evening-84071

03/27/2023, 3:27 PM
thanks!