kubernetes-sigs / kind

Kubernetes IN Docker - local clusters for testing Kubernetes
https://kind.sigs.k8s.io/
Apache License 2.0
13.34k stars 1.55k forks source link

How to purge unused image in repository from Kind #3735

Open carrulop opened 3 weeks ago

carrulop commented 3 weeks ago

Hello,

I would like to know if it is possible to remove those images that are unused in local repository from Kind. I usually working generating new images during my development, and each time that I create a new build from my application and I create an image with podman build, then I push this image to my local Kind cluster. My question is how can I free space in disk from the local repository for my Kind server.

I use Windows 11 version for Kind v0.24.0 go1.22.6, with podman 5.2.2.

Thanks a lot!

Best regards

stmcginnis commented 2 weeks ago

Even though you are using it with kind, that is up to the registry you are using and how it works. If you are using the registry container described in the script, this looks like a decent write up: https://azizunsal.github.io/blog/post/delete-images-from-private-docker-registry/

Note: Slack is probably a more efficient way to ask usage questions than filing issues. You will get a response here, but there are more people lurking in the #kind slack channel that may be able to answer questions. Or in this case, whatever the registry documentation recommends for support channels.

BenTheElder commented 2 weeks ago

My question is how can I free space in disk from the local repository for my Kind server.

For the nodes one option currently is docker exec $node crictl rmi --prune.

For the registry, see the comment above.