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

`kamel uninstall` should also delete leases

Open squakez opened this issue 3 years ago • 5 comments

I've uninstalled everything but I can still see leases around that won't let me install again an operator due to installation not allowed because operator with id 'camel-k-missing-deps' already exists, use the --force option to skip this check

squakez avatar Jul 21 '22 13:07 squakez

fyi @christophd

squakez avatar Jul 21 '22 13:07 squakez

I could not reproduce but I faced an issue with the platform Kamelets that should be fixed by https://github.com/apache/camel-k/pull/3553

essobedo avatar Aug 18 '22 17:08 essobedo

I confirm that leases (along with integrations, integration kits, builds, camel catalogs, Kamelet bindings...) are not deleted by the uninstall command however they don't prevent the install command to work as expected since the install command only checks whether an integration platform with the same name already exists in the namespace and the integration platform is properly removed by the uninstall command.

The lease exists in the namespace...

$ kubectl get lease -n foo                                                                                                          
NAME           HOLDER                                                                   AGE
camel-k-lock   camel-k-operator-848fd8785b-7knql_626532a4-c05f-4edb-8cd9-7f6294d6cc57   13m

but it doesn't prevent the install command to work as expected

kamel install -n foo                                                                                                  
OLM is not available in the cluster. Fallback to regular installation.
Warning: the operator won't be able to detect a local image registry via KEP-1755
Camel K installed in namespace foo 

Knowing that, shall we still remove the lease on uninstall?

NB: Once the new operator is installed in the namespace, a new lead is then elected such that the lease is automatically updated without the need to delete it first

essobedo avatar Aug 31 '22 16:08 essobedo

What version have you used for testing this? The failure happens in version >= 1.10 (also nightly) only.

squakez avatar Sep 02 '22 08:09 squakez

I tested it with 1.9.2, I can indeed reproduce it with 1.10, thx for the clarifications 🙏

essobedo avatar Sep 02 '22 08:09 essobedo

I've checked with @gansheer the expected behavior and we realized this is not a bug. Basically the lease is created by the operator Pod and it's correctly release when the Pod is terminating. It does not make sense to alter this behavior by the installation procedure.

squakez avatar Dec 07 '22 11:12 squakez