container K8 management - animeshtrivedi/notes GitHub Wiki
Bookmarks
- https://docs.docker.com/reference/cli/docker/container/run
- https://docs.docker.com/reference/cli/docker/buildx/build/ I was looking in this by building a dockerized ML environment (vLLM/DeepSpeed/FlexGen setup)
List images
Taken from the theme, Cleanup /var/lib/rancher/k3s/agent
sudo k3s crictl images
From https://github.com/k3s-io/k3s/issues/1900
https://github.com/k3s-io/k3s/issues/1900#issuecomment-644453072
kubernetes nodes automatically perform image garbage collection. You can find documentation on the default thresholds here: https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/#user-configuration
You can tune these thresholds on your k3s nodes by adding arguments to the service command line:
--kubelet-arg=image-gc-high-threshold=85 --kubelet-arg=image-gc-low-threshold=80
If for some reason you want to muck about with deleting things manually, you can try:
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
From docker
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES