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

To show the process of applying resource on resourcebinding status. #5019

Open
Patrick0308 opened this issue Jun 3, 2024 · 3 comments
Open
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Patrick0308
Copy link

Patrick0308 commented Jun 3, 2024

What would you like to be added:
To show the process of applying resource on resourcebinding status.

New Status Field:

currentResourceVersion: the current resource version need to be applied.
appliedResourceVersion:the full applied success resource version.
aggregatedStatus[].appliedResourceVersion: the applied resource version on a cluster.

FullyApplied Condition Reason

FullyApplied: Applying current resource version successfully. Status is true.
FullyAppliedFailed: Applying failed. Status is false.
Applying: In process of applying current resource version. Status is false

Example

if in process of applying resource:

  currentResourceVersion: "123"
  appliedResourceVersion: "122"
  phase: Applying
  aggregatedStatus:
  - applied: false
    phase: Applying
    clusterName: cluster1
    appliedResourceVersion: "122"
    health: Unknown
  - applied: false
    phase: Applying
    clusterName: cluster2
    appliedResourceVersion: "122"
    health: Unknown
  conditions:
  - lastTransitionTime: "2024-06-03T06:42:29Z"
    message: Binding has been scheduled successfully.
    reason: Success
    status: "True"
    type: Scheduled
  - lastTransitionTime: "2024-06-03T06:42:29Z"
    message: Applying resource on cluster1, cluster2
    reason: Applying
    status: "False"
    type: FullyApplied
  schedulerObservedGeneration: 7

if a cluster applied failed:

  currentResourceVersion: "123"
  appliedResourceVersion: "122"
  phase: ApplyFailed
  aggregatedStatus:
  - applied: true
    phase: Applied
    clusterName: cluster1
    appliedResourceVersion: "123"
    health: Unknown
  - appliedMessage: "error message"
    phase: ApplyFailed
    clusterName: cluster2
    appliedResourceVersion: "122"
    health: Unknown
  conditions:
  - lastTransitionTime: "2024-06-03T06:42:29Z"
    message: Binding has been scheduled successfully.
    reason: Success
    status: "True"
    type: Scheduled
  - lastTransitionTime: "2024-06-03T06:42:29Z"
    message: error message
    reason: FullyAppliedFailed
    status: "False"
    type: FullyApplied
  schedulerObservedGeneration: 7

if all clusters applied success:

  currentResourceVersion: "123"
  appliedResourceVersion: "123"
  phase: Applied
  aggregatedStatus:
  - applied: true
    phase: Applied
    clusterName: cluster1
    appliedResourceVersion: "123"
    health: Unknown
  - applied: true
    phase: Applied
    clusterName: cluster2
    appliedResourceVersion: "123"
    health: Unknown
  conditions:
  - lastTransitionTime: "2024-06-03T06:42:29Z"
    message: Binding has been scheduled successfully.
    reason: Success
    status: "True"
    type: Scheduled
  - lastTransitionTime: "2024-06-03T06:42:29Z"
    message: All works have been successfully applied
    reason: FullyAppliedSuccess
    status: "True"
    type: FullyApplied
  schedulerObservedGeneration: 7

Why is this needed:

Although the client updated resource, and checked FullyApplied condition status which is true, the client not sure that new resource was applied to each cluster successfully. Because maybe that's in process of applying.

@Patrick0308 Patrick0308 added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 3, 2024
@Patrick0308 Patrick0308 changed the title To show the process of applying on resourcebinding status. To show the process of applying resource on resourcebinding status. Jun 3, 2024
@grosser
Copy link
Contributor

grosser commented Jun 3, 2024

I like how thorough this is, but I also think a very minimal version could be good enough (the extra features like seeing it per cluster and current version could be nice for debugging in detail though)

  • we don't really need currentResourceVersion since that is in metadata.resourceVersion
  • we don't really need aggregatedStatus since we could set the version once all clusters are reconciled

@Patrick0308
Copy link
Author

Patrick0308 commented Jun 4, 2024

we don't really need currentResourceVersion since that is in metadata.resourceVersion.

To get FullyCondition status need current resource version information. However I just found resourcebinding has a current ResourceVersion already which is spec.resource.resourceVersion. So there don't need status.currentResourceVersion

we don't really need aggregatedStatus since we could set the version once all clusters are reconciled.

I wanna show clusters applied progress. I will add more details.

@grosser
Copy link
Contributor

grosser commented Jun 8, 2024

if you need per cluster then this design makes sense 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: No status
Development

No branches or pull requests

2 participants