Skip to content

The Deleter and Garbage Collector issuer with Kuberentes Dependent Resources #1127

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

Closed
csviri opened this issue Apr 3, 2022 · 2 comments · Fixed by #1164
Closed

The Deleter and Garbage Collector issuer with Kuberentes Dependent Resources #1127

csviri opened this issue Apr 3, 2022 · 2 comments · Fixed by #1164

Comments

@csviri
Copy link
Collaborator

csviri commented Apr 3, 2022

In Dependent Resources Deleter means that the resources needs to be explicitly deleted during a cleanup. However also implies that the resource is coupled to the custom resource in a sense that during the reconciliation this resource might be deleted. See:

https://github.com/java-operator-sdk/java-operator-sdk/blob/d7498cc833efe447eb50467fd8fb8f13da79adc3/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStandaloneDependentsReconciler.java#L68-L72

For managed dependent resources this is handled automatically by the system, also means that finalizer will be utilized for the custom resource.

For managed dependent resources there is an issue with this in terms of deleting, regarding the resources which are garbage collected rather then explicitly deleted. Note that in scope of v3.0.0 the deletion during a reconciliation was out of the scope for managed resources. But with workflows this will be introduced, see: #850 (If Condition not holds, the resource should be deleted during the reconciliation)

Issue / Goal

The issue is that for Kubernetes dependent resources where owner references can be used, we want to have the resource Deleter if it might be deleted also during the reconciliation, but we don't want to use finalizers because of this, and we don't want to explicitly delete the dependent during cleanup phase, rather the k8s garbage collection needs to clean it up.

Proposed Solution

A way we could handle this globally is to introduce a GarbageCollected empty marker interface, that when implemented in combination with Deleter, would have the desired effect as describe above. Thus the resource might be deleted explicitly during the reconciliation, but won't be at cleanup, and finalizer won't be added because of this resources.

@csviri csviri self-assigned this Apr 19, 2022
@csviri csviri linked a pull request Apr 19, 2022 that will close this issue
@csviri
Copy link
Collaborator Author

csviri commented Apr 19, 2022

@csviri
Copy link
Collaborator Author

csviri commented Apr 21, 2022

check: garbage collector makes sense only if owner references can be added. So it is loosely coupled also with SecondaryToPrimaryMapper.

@csviri csviri closed this as completed May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant