kamel uninstall --all does not remove Kamelets
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
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.
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.
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.
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!
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.
Could have been fixed by https://github.com/apache/camel-k/pull/3553 (the Kamelets removal issue)
True, thanks for the info!