enix / kube-image-keeper

kuik is a container image caching system for Kubernetes
MIT License
431 stars 31 forks source link

Simple Uninstallation of Resources and Helm Chart Instructions #366

Closed nikos445 closed 1 week ago

nikos445 commented 1 month ago

Please find below some uninstallation instructions that may help some people... Please add it to README.md

paullaffitte commented 1 month ago

Thanks for you submission, indeed we miss some details about this in our documentation.

However it is a bit dirty to do it that way, most of the time you shouldn't mess with finalizers unless you really know what you're doing (in that case I think you do but if we add it in the readme I prefer to take a cleaner approach).

So the solution would be to first disable rewriting of the pods, for instance by deleting the mutating webhook. Then you would restart pods using cached images, or rewrite them. Then delete kuik custom resources. And then only uninstall the helm chart.

It is very important to stop using images from kuik before uninstalling. Indeed, if some pods are configured with the imagePullPolicy: Always and .controllers.webhook.ignorePullPolicyAlways value of the helm chart is set to false, then, in a case of a restart of a container (for example in an OOM scenario), the pod would not be able to pull its image anymore and will go in the ImagePullBackOff error state until someone manually fix its image.