Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document foreground/background deletion behavior more completely #664

Open
jbw976 opened this issue Dec 22, 2023 · 0 comments
Open

Document foreground/background deletion behavior more completely #664

jbw976 opened this issue Dec 22, 2023 · 0 comments

Comments

@jbw976
Copy link
Member

jbw976 commented Dec 22, 2023

What's Missing?

@sttts was asking on Slack recently about the deletion of nested composite resources and understanding what is happening during that process, because it can be confusing.

@bobh66 explained this well in the below message about foreground and background deletion, which is copied below for convenience and posterity and with minor edits for readability:

The composite reconciler leaves deletion responsibilities to kubernetes - so when the default background deletion occurs and the k8s GC goes through the tree and marks everything deleted, the composite reconciler simply deletes the connection secret and removes it's finalizer which causes it to disappear. The MRs obviously have a lot more work to do on deletion and so they may stick around forever if they get stuck and cannot delete the remote resource, In the mean time the claim and all composites are long gone and the MRs are left orphaned.

We expose support for Foreground deletion with defaultCompositeDeletePolicy: Foreground, and implement it under the covers by setting the blockOwnerDeletion flag in the owner reference. We also updated the claim reconciler to delete the composite using the specified propagation policy so that we can now delete either a claim or a top-level composite using foreground deletion and kubernetes will do a "bottom up" deletion starting with the MRs. If an MR is stuck the entire chain of composites above it will stay in place until the MR is deleted. This makes finding stuck resources a lot easier. The helm and kubernetes providers act like the other providers in that the MR does not remove it's finalizers until the associated chart/object has been deleted.

We should add these details to the documentation in a discoverable place, so that users can make better decisions and be more informed about how deletion works in Crossplane and what their options are.

This is touched on in https://docs.crossplane.io/latest/concepts/composite-resource-definitions/#defaultcompositedeletepolicy, but it's not a complete explanation of the topic and it is hard to find that unless you already know what the field is called. Instead, there could be a general topic about XR deletion, perhaps added to the Usage documentation if not addressed as a topic on its own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant