kyma-project / lifecycle-manager

Controller that manages the lifecycle of Kyma Modules in your cluster.
http://kyma-project.io
Apache License 2.0
9 stars 30 forks source link

Delete modes for modules #1211

Open janmedrek opened 6 months ago

janmedrek commented 6 months ago

Description

Kyma Lifecycle Manager should support two different cases for the deletion of modules:

This supports use cases mentioned in this proposal, such as cross-use of OS and managed modules, adapting configuration and the cleanup behaviour desired by the user.

The majority of the scenarios depend on https://github.com/kyma-project/lifecycle-manager/issues/963 as information on which the module manages resources is needed.

As for the detailed behaviour of the deletion modes:

This should be done on the per-module level, different modules in one Kyma should be able to have different deletion modes.

Example:

Reasons

With the reasoning behind https://github.com/kyma-project/community/issues/870, there comes a requirement to adapt to different use cases for the Kyma usages. We need to support different scenarios of cross-use of OS and managed modules, configurations and cleanups.

The deletion logic gets convoluted and it would be desired to split it into three different, transparent modes.use cases

Acceptance Criteria

pbochynski commented 6 months ago

In my opinion force delete should be executed by the user using UI/CLI. User should be informed about the list of managed resources that will be deleted to make a conscious decision. The only situation where force deletion can be done without user interaction should be Kyma runtime deprovisioning. But that part can be done by a separate process.

janmedrek commented 5 months ago

When it comes to determining which resources are "managed" there are two approaches:

The second option requires a bit more effort in the implementation part, but in the end - provides a simpler CRD design.

janmedrek commented 3 months ago

Issue for "unmanaging" the modules: https://github.com/kyma-project/lifecycle-manager/issues/1427

jeremyharisch commented 2 months ago

Acceptance Criteria for EPIC:

Timebox: 2 Days

nesmabadr commented 1 month ago

Sub Issues:

nesmabadr commented 1 month ago

We agreed on the following:

janmedrek commented 1 month ago

Image

ruanxin commented 1 month ago

@janmedrek , I think this epic can be converted together with that "unmanaging" the modules: https://github.com/kyma-project/lifecycle-manager/issues/1427.

Basically, this "Ignore" mode is regarding how KLM deal with those modules switch by user from "managed" module to "unmanaged", right? strictly speaking, it's not deleting, for deleting module, KLM should always use blocking mode.

Then I aligned with your proposal, introducing managed field to spec.modules makes more sense, and for those modules to become "unmanaged", they still keep in the spec.modules, KLM just take care of force deleting related manifest CR. But for module removed from spec.modules, it has the meaning to indeed delete this module by KLM with blocking strategy.

Pros:

ruanxin commented 1 month ago

@janmedrek, regarding Default CR Strategy, the Ignore mode, as I mentioned in daily, we currently have bug which mentioned by PB in his proposal point 4:

With Ignore strategy KLM should not delete module deployment as it can lead to orphan resources with misleading status (module config with state Ready, but operator undeployed). With CreateAndDelete strategy the deletion process should be done with blocking strategy (do not delete operator manifest before all managed resources are gone - point no 2).

To make it clear, current Ignore strategy, as you mentioned "Default CR not removed when the module is disabled", is not a solid solution, when module is disabled, the module operator will be remove, if the Default CR is not removed, then there is no operator update it's status.

Please create one issue related to this problem, and clarify following questions:

  1. Does it means for the fixed Ignore strategy, the solution is KLM does not delete any module resources?
  2. Then what's the different between your IgnoreDeletion module deletion strategy with this fixed Ignore strategy?
janmedrek commented 1 month ago

@ruanxin thanks for the insights.

From that point of view, it does not make sense to keep the current "ignore" strategy. Let us align on this tomorrow and I will update the tickets. Most likely we will keep the current blocking strategy for deletion and convert this to the "unmanage" ticket.