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

Finalizer for ThirdPartyResourceData #35949

Closed
brendandburns opened this issue Nov 1, 2016 · 12 comments
Closed

Finalizer for ThirdPartyResourceData #35949

brendandburns opened this issue Nov 1, 2016 · 12 comments
Assignees
Labels
area/apiserver area/custom-resources sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@brendandburns
Copy link
Contributor

Mentioned elsewhere, but not fully covered in an issue.

Need to add a finalizer to wipe out etcd data on object deletion.

@kubernetes/sig-api-machinery

@brendandburns brendandburns self-assigned this Nov 1, 2016
@k8s-github-robot k8s-github-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Nov 1, 2016
@deads2k
Copy link
Contributor

deads2k commented Nov 1, 2016

Mentioned elsewhere, but not fully covered in an issue.

Need to add a finalizer to wipe out etcd data on object deletion.

I agree. Related to kubernetes/enhancements#95

@caesarxuchao
Copy link
Member

Do you mean delete all the thirdpartyResourceData when the thirdpartyResource is deleted?

@deads2k
Copy link
Contributor

deads2k commented Nov 1, 2016

Do you mean delete all the thirdpartyResourceData when the thirdpartyResource is deleted?

Yeah. Otherwise recreation of the same TPR does whacky stuff.

@caesarxuchao
Copy link
Member

Looks like it could use the synchronous garbage collection: https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/synchronous-garbage-collection.md

@liggitt
Copy link
Member

liggitt commented Nov 1, 2016

no need for the delete API call to hang while it's trying to clean up the related third party, an async finalizer seems like it would be better

@deads2k
Copy link
Contributor

deads2k commented Nov 1, 2016

no need for the delete API call to hang while it's trying to clean up the related third party, an async finalizer seems like it would be better

From what I gather, synchronous garbage collection doesn't block the delete call. The delete call completes without deleting the resource, instead it marks a finalizer and at some later point a controller cleans up the dependants and deletes the head.

@liggitt
Copy link
Member

liggitt commented Nov 1, 2016

does that require setting ownerRef on every thirdpartyresourcedata object?

@deads2k
Copy link
Contributor

deads2k commented Nov 1, 2016

does that require setting ownerRef on every thirdpartyresourcedata object?

Now that bit makes me very unhappy. None may remain, and ownerRef may allow some to escape.

@brendandburns
Copy link
Contributor Author

I thought about this some more, I think the simplest solution is to mark the TPR as 'deleting' which has the effect of blocking all new writes to the TPR, but doesn't actually delete it. Then a GC controller picks up the TPRs that are deleting and works to delete all of the resources owned by that TPR.

Once the TPR is actually empty, then it is deleted by the GC controller.

Thoughts?

@deads2k
Copy link
Contributor

deads2k commented Nov 4, 2016

Then a GC controller picks up the TPRs that are deleting and works to delete all of the resources owned by that TPR.

Once the TPR is actually empty, then it is deleted by the GC controller.

Thoughts?

Because the GC controller can be influenced by the end user (user who can modify a Foo, can remove the ownerRef), I think that unsuitable. I want the stronger control of an unconditional finalizer.

@adohe the finalizer issue I mentioned.

@adohe-zz
Copy link

adohe-zz commented Nov 4, 2016

@deads2k Thanks :)

@enisoc
Copy link
Member

enisoc commented Jun 12, 2017

This is fixed for CustomResource, the new version of TPR. Users should migrate to CustomResource, as there are no plans to add a finalizer for TPR which is now deprecated.

@enisoc enisoc closed this as completed Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver area/custom-resources sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

7 participants