-
Notifications
You must be signed in to change notification settings - Fork 31
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
Can't use Kubernetes delete cascade orphan #261
Comments
Hi @dacofr! I think that makes a lot of sense to support all three deletion modes. If I'm reading the docs (also this one) correctly the controller (fiaas-deploy-daemon) should still delete the children in foreground mode. When using foreground of orphan mode, it seems the controller is expected to update the Application object and remove those finalizers. This part also need to be implemented for it to work fully. But I think if the children still has the ownerReference when that happens, they'll still be automatically deleted. Do test that part though. |
Found some more info here that seems to verify what I said above. |
As I understand the garbage collector documentation, as well as observed behavior is that garbage collection of resources where all owner references reference objects that no longer exist, is automatic. I understand the different cascade modes to work like
Finalizers can be set on a resource by controllers (such as fiaas-deploy-daemon) to control its deletion, for example by blocking deletion of a resource until some external state is deleted, at which point the controller which set the finalizer initially should remove the finalizer to indicate to the garbage collector that the resource can safely be deleted. fiaas-deploy-daemon doesn't set any finalizers, so I don't think we need to consider those in this context. It seems to me like both foreground and background cascading deletion for Application resources works like it should already. There is a PR (#101) that attempted to make this change earlier which never landed, but as the PR is quite old and stale it may be difficult to continue from directly. |
Alright, I actually tested it now. Both foreground and orphan seems like it's working with simply commenting out the delete function. I guess I must be misunderstanding the docs somehow 🤷♂️ |
Hello @perj and @oyvindio, thanks both for your feedback 👍 Didn't find this existing PR. |
In case of #262 is ready 😃 |
Hi 👋
With the current implementation of Fiaas, we cannot use :
kubectl delete fa bla-bla --cascade=orphan
Some objects like PDB, RoleBindings, SA are well orphaned after deletion (owner reference is removed and objects still remain clusters), but that's not the case for Deployment, Service, Ingress because there is an explicit deletion that is done here :
https://github.com/fiaas/fiaas-deploy-daemon/blob/master/fiaas_deploy_daemon/deployer/kubernetes/adapter.py#L69
This made sense in the past, but now that each objects has an owner reference, we can let Kubernetes do the garbage collection for us.
I will send a PR to remove this explicit deletion, WDYT ?
Thanks
The text was updated successfully, but these errors were encountered: