Clarification on Crossplane Deletion Behavior #6826
Unanswered
G-Salviati
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm writing to ask for clarification on how Crossplane deletes resources from a Composition. I'm currently using version 1.19.1.
In my use case, I need to delete an XR (e.g., CompositeResourceDefinition), whose Composition creates MRs (Managed Resources) and potentially nested XRs, without immediately deleting the top-level XR from the cluster.
My initial thought was to define spec.defaultCompositeDeletePolicy: foreground in the XRD (CompositeResourceDefinition). However, this parameter doesn't seem to have any effect unless Claims are used to instantiate the XRs. I'm currently instantiating XRs directly using manifests, not Claims, and it's difficult for me to change this workflow at the moment.
So, I tried to delete the XRs using kubectl delete XRName --cascade=foreground --wait=false to achieve the desired behavior. The top-level XR isn't deleted until all the composed resources are completely eliminated.
However, I've noticed a problem in some of my Compositions where I define Usage to get a specific deletion order between resources. It seems that when I use the --cascade=foreground flag, the garbage collector doesn't take the Usage into account and tries to delete everything simultaneously. I guess this problem involves ProviderConfigUsages too.
If I don't use this flag, the Usage is respected by the controller, but of course, the top-level XR is deleted as soon as I issue the delete command.
Do you have any idea why this happens? Is there a simple way to achieve the behavior I've described?
Is there any detailed documentation on the deletion process, specifically on how controllers use owner references, finalizers, and usages?
Is managing the deletion order simpler in version 2.0?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions