Skip to content

k3s

see also some kubernetes / k8s stuff:

cleanup unused images

that's how things start. cleanup unused images, sometimes I need to do that and besides what kubernetes things since other stuff is also running on the same system (I know).

list images:

sudo k3s crictl images

delete images not currently in use:

sudo k3s crictl rmi --prune

source

delete individual image

sudo k3s crictl rmi docker.pkg.dev/package/packagename:latest

import docker / container image

docker save localhost/shaarli | sudo k3s ctr images import -

make sure to set the deployment imagePullPolicy to Never:

how to use it in a kubernetes yaml file:

containers:
- image: localhost/shaarli:latest
  imagePullPolicy: Never