Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesnt work "kamel kit delete" #4628

Closed
nuhyurduseven opened this issue Jul 31, 2023 · 9 comments
Closed

doesnt work "kamel kit delete" #4628

nuhyurduseven opened this issue Jul 31, 2023 · 9 comments
Labels

Comments

@nuhyurduseven
Copy link

Hi,
I can not delete camel kits via kamel kit delete kit-<random_number> command. Also kamel kit delete --all command doesn't work. I just use kamel reset to delete all kit. However, it's not an effective way. May kamel cli tool be problematic? How can I solve this issue? I am using latest kamel version and I am using minikube.

@gansheer
Copy link
Contributor

gansheer commented Jul 31, 2023

Hi,

You probably can't delete the kit with the CLI command because it was created by the operator, so this is not a bug from the CLI. Therefore it is a platform one which is supposed to be "read only" thus not managed by the end user. This command is only available on user created integration kit.

You can delete it by removing the custom resource kubectl delete integrationkit.camel.apache.org/kit-xxxxxxxxx and removing the container image in your image registry. Be mindful that it is better to ensure any integration declaring it has been removed as well.

@squakez squakez added the area/cli Kamel CLI label Jul 31, 2023
@squakez
Copy link
Contributor

squakez commented Jul 31, 2023

As @gansheer is pointing out, there is no "safe" way to delete an IntegrationKit because it could be used by any other Integration or as a base image for other IntegrationKits. In order to make sure that an IntegrationKit is safe to delete, you need to make sure it is not referenced by any other Integration or IntegrationKits.

@nuhyurduseven
Copy link
Author

thanks @squakez . I deleted an image safely after control via kamel describe kit kit-xxxxxxx command. btw @gansheer's solution works, I deleted an image. But I notice that there are many images in registry service. When I use minikube image ls, I got many camel-k-kit,even deleted ones before. How can I solve this problem? Why minikube remove images from registry?
I used kamel reset, so all images, kits, integrations were gone. But I still see that the images are not removed like below.
$ minikube image ls
.....
.....
.....
//default/camel-k-kit-cj3qui2s8cu92eecfg3g:
/default/camel-k-kit-cj12rt2s8cu5l5ecufq0:
/default/camel-k-kit-cisdsnrtmpsjmj398i2g:
/default/camel-k-kit-cisdsajtmpsjmj398i20:
...
....

@squakez
Copy link
Contributor

squakez commented Jul 31, 2023

Yes, this is an expected behavior. We've worked and discussed possible solutions see #4552 but we haven't yet found a proper way to deal with it. The best approach would be to provide some script to list dangling images and delete them from the registry.

@gansheer
Copy link
Contributor

Interaction with any image registry from the camel-k CLI would be difficult because we would no longer be in the use case of a kubernetes API.

On minikube the solution is to identify your kit images with something like minikube image ls --format='table' | grep kit and deleting them with minikube image rm <image_id>. As @squakez said, it could be scripted to check if the kit is still in use, but as you can see here we are using the minikube CLI which is specific to the registry you are using.

@nuhyurduseven
Copy link
Author

OK. I deleted images with minikube image rm. If I use kubernetes instead of minikube, can I delete a specific images via kamel ? Because I have to use organization registry when I use camel-k on kubernetes. In this case, I have to delete images with an automation script, right?

Btw I got manifest errors sometimes when the operator fetch an image and image building steps. I can't create a new integration with new image even if I run kamel reset command. This is not good for production environment? Why does it behave like this ?

@squakez
Copy link
Contributor

squakez commented Aug 1, 2023

Registry cleaning is some operation which has to be performed with the proper company privileges. I would not expect a production environment to let the operator to take care of such a sensitive operation. Remind that the registry images could be shared by other cluster as well, so, any delete operation must be done with particular care to avoid any later error when trying to run new Integrations.

@nuhyurduseven
Copy link
Author

I got it. It makes sense. "kamel kit delete" feature is not require in this situation. Registry images and kits can be deleted in registry with kubectl command.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants