timoni icon indicating copy to clipboard operation
timoni copied to clipboard

[Proposal] Multi-step delete

Open robinkb opened this issue 4 months ago • 4 comments

Hello!

First of all, thank you for developing Timoni! It's already a wonderful tool, and I hope to see it grow further. On to business.

I am building a Kubernetes cluster using Timoni with Flux. Timoni is used to install Flux, and a set of OCIRepository and Kustomize resources. The OCI artifacts are Kubernetes manifests built with timoni build. The creation of the Kustomize resources is ordered using Timoni's multi-step apply. Components are brought up in an ordered manner without errors.

Unfortunately, tearing down the cluster is not straight-forward. Multi-step delete would make this easier, where resources are deleted in the reverse order defined in the multi-step apply.

If you are open to this suggestion, I could have a crack at developing the feature based on the multi-step apply functionality.

Other solutions that I've checked:

  1. Flux Kustomization's spec.dependsOn. Unfortunately, defined dependencies are not honored during deletion. This applies to the Helm controller as well as the Kustomize controller. These issues are quite old at this point, and it appears to be a complicated problem in Flux because of multi-tenancy reasons.
  2. I see that Bundles do delete instances in reverse. Perhaps I should be using bundles to orchestrate my cluster instead? Even so, I think that multi-step destroy would still be useful to have on the module level.

robinkb avatar Feb 25 '24 20:02 robinkb