Closed nikos445 closed 1 week 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.
Please find below some uninstallation instructions that may help some people... Please add it to README.md
Remove of helm chart:
helm uninstall --namespace kuik-system kube-image-keeper enix/kube-image-keeper
Remove of CRD (repositories.kuik.enix.io) (Resources Stuck in terminating):
RESOURCES=$(kubectl get repositories.kuik.enix.io --no-headers -o custom-columns=":metadata.name")
for n in $RESOURCES; do kubectl patch repositories.kuik.enix.io $n --type json --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'; done
Remove of CRD (cachedimages.kuik.enix.io) (Resources Stuck in terminating):
RESOURCES=$(kubectl get cachedimages.kuik.enix.io --no-headers -o custom-columns=":metadata.name")
for n in $RESOURCES; do kubectl patch cachedimages.kuik.enix.io $n --type json --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'; done