camel-k icon indicating copy to clipboard operation
camel-k copied to clipboard

kamel uninstall --all does not remove Kamelets

Open christophd opened this issue 3 years ago • 3 comments

kamel CLI provides the uninstall option --all

As a user I would expect the command to remove all Camel K custom resources including all Kamelets that have been installed automatically with the operator.

Unfortunately the Kamelets are not removed. Only the Kamelet CRD is removed. We should make sure to remove all Camel K custom resources when doing an uninstall --all

christophd avatar Jun 07 '22 18:06 christophd

I think this was discussed in the past. Kamelets are generic contents, not necessarily bound to the Camel K operator (ie, you can create a kamelet and let any other system use it). I'd suggest instead we include a parameter on kamel uninstall in order to simplify the cleanup if needed. Otherwise, as a fallback, you can always use kubectl and delete all unnecessary Kamelets.

squakez avatar Jun 10 '22 08:06 squakez

IMO --all option is exactly that option where everything should be removed including Kamelets. The short description of --all option is "Do uninstall all Camel K resources".

Also all CRDs (including Kamelet and KameletBinding) are removed with uninstall --all at the moment and only the Kamelet custom resource instances are not removed. This does no make any sense to me because the user will not be able to work with those left overs once the CRD is missing.

christophd avatar Jun 10 '22 08:06 christophd

In fact the left overs are subject to future issues because when the user performs uninstall --all and then does install on the same cluster the newly installed operator will start to reconcile the "old" Kamelets again. In case the namespace of the old Kamelets does not exist anymore for some reason the new operator gets lots of errors in reconciling these left overs.

christophd avatar Jun 10 '22 08:06 christophd

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!

github-actions[bot] avatar Sep 09 '22 00:09 github-actions[bot]

Looking deeper, it seems we already should support the uninstall of bundled kamelet see https://github.com/apache/camel-k/blob/4d248940a283e81dce6fa9845001d032889baef6/pkg/cmd/uninstall.go#L479. For some reason, we may miss the setting of the label during the installation procedure.

squakez avatar Sep 09 '22 07:09 squakez

Could have been fixed by https://github.com/apache/camel-k/pull/3553 (the Kamelets removal issue)

essobedo avatar Sep 09 '22 09:09 essobedo

True, thanks for the info!

squakez avatar Sep 09 '22 10:09 squakez