-
Notifications
You must be signed in to change notification settings - Fork 161
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
Application Garbage Collection #7
Comments
@kow3ns thanks for bring this up here and in the KEP. It's inspired a number of great conversations I've had the opportunity to have with folks. The approach where the controller monitors and adds owners refs to create/delete events has some complexities. For example,
I'm not sure of the right answer but I'd like the more opinionated approaches to be layered on (optional in some form) rather than required by all unless all want them. |
@mattfarina In the scenario with shared database, I'd say the db should not be marked as being a part of one application or another, but a separate entity (possibly having its own application). Between the two approaches given by @kow3ns, I'm in favor of the second one (controller attaching ownerrefs), as most user-friendly and able to cover the adoption scenario out of the box. Ideally the users would be prevented from deploying overlapping applications, but I understand this is currently not supported due to race conditions. In that case, it would be the controller's job to:
One more complication in the controller's implementation would be watching changes to application's selector field and re-adopting or un-owning resources accordingly. |
I'm in favor of the controller attaching ownerrefs. About the case of shared resources, we may still want to select them via the 'ApplicationCRD'. So what about adding a field on the components so users can protect them, like @kow3ns , If the
|
Building the Operator Lifecycle Manager, we basically discovered that we want a queryable GC API for asking questions of the ownership tree. We have some internal proposals and I know some of the CoreOS upstream contributors poked around seeing if it was a reasonable initiative. |
@konryd I have some thoughts...
We are now discussing opinions on app operation and resource "linking". Kubernetes is not a PaaS and there's intent around not being opinionated as a PaaS would be. That way many can build their own processes on top of k8s. I'd argue that the default solution for describing an application, provided by the k8s project, is also not opinionated on decisions like this.
This is another opinionated design. Kubernetes has been focused on infra. Why should the k8s take up an opinion like this? Remember, this project is trying to help solve tool interoperability for apps. It is not trying to solve app operation which is more complicated than any one tool can cover. Operators are a great example of the need for different business logic for different apps. @kow3ns When it comes to garbage collection, in the general non-opinionated sense, what felt user problem are we trying to solve in a v1? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There are at least two ways to deal with garbage collection of application resources. The first, and simplest, approach is to inject owner reference into each component of the application using the Name, APIVersion, and Kind of the Application CRD. This would work as follows. There is no need to worry about injecting OwnerReferences into intermediate or children objects (e.g. If an OwnerReference is injected into a Deployment, chain garbage collection will delete its ReplicaSets and their Pods). When the Application is deleted the Garbage Collector will delete all Orphaned children. While this has the benefit of simplicity, it has a few drawbacks.
Another approach would be to construct a graph based controller using the Application's Selector and appropriate labels on children objects to indicate ownership. This controller would watch for the creation of all objects in the system and establish ownership by automatically injecting OwnerReferences. As above, when the Application object is deleted, the Garbage Collector will delete its children.This mitigates the need for tools to inject OwnerReferences, and it ensures that the Garbage Collector will not delete an Application's children prior to creation of the Application (i.e. there need not be a serialized ordering between observation of Application creation and the creation of its children), but it has drawbacks as well.
Another option is to begin with user tool injected OwnerReferences, and, when the full requirements of Garbage Collection become well understood after some period of production usage, automate the process by adding OwnerReference marking in the Application controller. The controller can be implemented in a way that is strictly backward compatible with user injected OwnerReference. In fact, in order function properly it must be compatible with user injected OwnerReferences.
The text was updated successfully, but these errors were encountered: