karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.49k stars 888 forks source link

When There Will Be More Than One Object Declared in One Work #3820

Open lxtywypc opened 1 year ago

lxtywypc commented 1 year ago

Please provide an in-depth description of the question you have: The field .spec.workload.manifests of work is a list type, that means it allows more than one object decalred in one work. But in a common workflow, the work is created follow the binding, and could be related to one binding only. The object declared in binding is unique, so there could not be chances to put more than one object in one work under normal circumstances.

The only scene matched this I could consider is that users would create single work manually.

But it seems there might be some potential problems, for example:

  1. If not all of object has been applied successfully, the only Applied condition in work would set to False, and we would be unable to recognize which object had been appied successfully. How would we theat the status in this situation?
  2. If an object is refered to the same object decalred in another work, what would happen?

Is that matched the design? Or is there any other scenes under which it is necessary?

What do you think about this question?:

Environment:

XiShanYongYe-Chang commented 1 year ago

IMOP, in the current mainstream process of resource distribution in Karmada, as you mentioned, only a single resource exists in work. This may remain the case for a long time. From the perspective of work alone, it serves as a container for resources and can accommodate one or multiple resources. In future scenarios, work may be directly used to package resources for certain operations without relying on the current propagation process. Therefore, I think that the ability of work to accommodate multiple resources does not conflict with our current practice of using it to distribute single resources.

Returning to the question you mentioned, for the first problem, if there are multiple resources involved in the work, relying solely on the condition may not be accurate enough. I think we need to consider both the condition and manifest status together to determine the status of a particular resource.

For the second question, perhaps we should prevent such a situation from happening. If this situation does occur, would it be acceptable if no conflicts arise?