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

Add status sub-resource to ResourceExport/Import and ClusterSet #2367

Merged
merged 4 commits into from
Jul 24, 2021

Conversation

abhiraut
Copy link
Contributor

@abhiraut abhiraut commented Jul 8, 2021

Signed-off-by: abhiraut [email protected]

@abhiraut abhiraut requested a review from suwang48404 July 8, 2021 19:10
@abhiraut
Copy link
Contributor Author

abhiraut commented Jul 8, 2021

@suwang48404 let me know if this looks good to you. I have incorporated your suggestion in to this.

@suwang48404
Copy link
Contributor

also run "make manifest" so that CRD files and manifests are updated accordingly,

@abhiraut
Copy link
Contributor Author

abhiraut commented Jul 8, 2021

also run "make manifest" so that CRD files and manifests are updated accordingly,

done

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple nits, LGTM
other folks should probably review as well


const (
// ClusterSetReady indicates whether ClusterSet is ready.
ClusterSetReady ClusterSetConditionType = "ClusterSetReady"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this is typically just "Ready" in K8s APIs. Am I wrong? Maybe we can avoid repeating the resource name in the status name: Ready, IsLeader, ImportSucceeded, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i saw a mix in Pod, where there is Ready and PodScheduled. but lets do Ready.

suwang48404
suwang48404 previously approved these changes Jul 8, 2021
Type ResourceImportConditionType `json:"type,omitempty"`
// Status of the condition, one of True, False, Unknown
Status v1.ConditionStatus `json:"status,omitempty"`
ClusterID string `json:"clusterID,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I'd suggest to extract ClusterID out, and put it in ResourceImportClusterStatus; where I suppose each ResourceImportClusterStatus reports import status from one cluster?
  2. consider rename ResourceImportClusterCondition to ResourceImportCondition to match ResourceExportCondition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. I also updated the ClusterStatus to include the clusterID in there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess the difference is: ResourceExportStatus is for a single cluster, but ResourceImportStatus includes multiple clusters. But agree the naming might cause some confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. updated in the latest commit

Type ResourceImportConditionType `json:"type,omitempty"`
// Status of the condition, one of True, False, Unknown
Status v1.ConditionStatus `json:"status,omitempty"`
ClusterID string `json:"clusterID,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess the difference is: ResourceExportStatus is for a single cluster, but ResourceImportStatus includes multiple clusters. But agree the naming might cause some confusion.

// Important: Run "make" to regenerate code after modifying this file
// TBD
// Total number of member clusters configured in the set.
TotalClusters int32 `json:"totalClusters,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we calculate from member clusters and their status? Maybe we just like a more convenient way?

// Total number of clusters ready and connected.
ReadyClusters int32 `json:"readyClusters,omitempty"`
// The overall condition of the cluster set.
Conditions []ClusterSetCondition `json:"conditions,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably I did not follow all discussions here, but could we know the overall status from the member cluster cluster status and conditions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can.. i think this was for convenience, a bit like how Deployment has some overall status at the top and more details in conditions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Works for me too.

Signed-off-by: abhiraut <[email protected]>
@abhiraut
Copy link
Contributor Author

@suwang48404 any more comments from you?

// Total number of clusters ready and connected.
ReadyClusters int32 `json:"readyClusters,omitempty"`
// The overall condition of the cluster set.
Conditions []ClusterSetCondition `json:"conditions,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Works for me too.

)

// ResourceImportCondition indicates the condition of the ResourceImport in a cluster
type ResourceImportCondition struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But do you think later we can have overall ResourceImportCondition, in addition to the per Cluster Conditions? I do not have an opinion what naming is better; just like to check what you think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was my original intention that's why named it with Cluster in it originally. Maybe if we decide to introduce overall status later, something like ResourceImportOverallStatus or ResourceImportClusterSetStatus, if we want to keep this (ResourceImportCondition) naming today to be consistent with the ResourceExportCondition

suwang48404
suwang48404 previously approved these changes Jul 19, 2021
@abhiraut
Copy link
Contributor Author

@antoninbas @tnqn @jianjuns any more comment before we merge this?

@jianjuns
Copy link
Contributor

@antoninbas @tnqn @jianjuns any more comment before we merge this?

Not from me.

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a minor comment about doc format.

ResourceExportSucceeded ResourceExportConditionType = "Succeeded"
)

// ResourceExportCondition indicates the readiness condition of the ResourceExport
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing trailing dot in several places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: abhiraut <[email protected]>
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhiraut abhiraut merged commit d2afbe1 into antrea-io:feature/multi-cluster Jul 24, 2021
@abhiraut abhiraut deleted the mc/status branch July 24, 2021 00:21
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Aug 27, 2021
abhiraut added a commit to abhiraut/antrea that referenced this pull request Aug 27, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Aug 30, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Aug 30, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Sep 10, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Sep 10, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Sep 10, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 3, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 3, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 3, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 3, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 3, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 3, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 3, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 4, 2021
luolanzone pushed a commit that referenced this pull request Nov 4, 2021
luolanzone pushed a commit that referenced this pull request Nov 8, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 10, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Nov 15, 2021
luolanzone pushed a commit that referenced this pull request Nov 22, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Dec 13, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Dec 22, 2021
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Jan 16, 2022
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Jan 18, 2022
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Jan 18, 2022
…ea-io#2367)

Status sub-resource for multi cluster CRDs

Signed-off-by: Abhishek Raut <[email protected]>
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Jan 19, 2022
…ea-io#2367)

Status sub-resource for multi cluster CRDs

Signed-off-by: Abhishek Raut <[email protected]>
luolanzone pushed a commit that referenced this pull request Jan 19, 2022
Status sub-resource for multi cluster CRDs

Signed-off-by: Abhishek Raut <[email protected]>
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Jan 20, 2022
…ea-io#2367)

Status sub-resource for multi cluster CRDs

Signed-off-by: Abhishek Raut <[email protected]>
luolanzone pushed a commit to luolanzone/antrea that referenced this pull request Jan 20, 2022
…ea-io#2367)

Status sub-resource for multi cluster CRDs

Signed-off-by: Abhishek Raut <[email protected]>
yanjunz97 pushed a commit to yanjunz97/antrea that referenced this pull request Feb 14, 2022
…ea-io#2367)

Status sub-resource for multi cluster CRDs

Signed-off-by: Abhishek Raut <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants