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 metadataSufficient status to indicate wether cluster have get all api-resource #1804

Closed
wants to merge 1 commit into from
Closed

Add metadataSufficient status to indicate wether cluster have get all api-resource #1804

wants to merge 1 commit into from

Conversation

duanmengkk
Copy link
Member

@duanmengkk duanmengkk commented May 17, 2022

Signed-off-by: duanmeng [email protected]

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #1673

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label May 17, 2022
@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 17, 2022
@duanmengkk duanmengkk changed the title ignore the error when getting the list of APIs installed in the membe… WIP:ignore the error when getting the list of APIs installed in the membe… May 17, 2022
@karmada-bot karmada-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 17, 2022
@duanmengkk duanmengkk changed the title WIP:ignore the error when getting the list of APIs installed in the membe… Add warn status of the member cluster when failed get all supported resources from server May 17, 2022
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 17, 2022
@duanmengkk
Copy link
Member Author

/retitle Add warn status of the member cluster when failed get all supported resources from server

@karmada-bot
Copy link
Collaborator

@duanmengkk: Re-titling can only be requested by trusted users, like repository collaborators.

In response to this:

/retitle Add warn status of the member cluster when failed get all supported resources from server

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.

@duanmengkk
Copy link
Member Author

duanmengkk commented May 17, 2022

/assign @XiShanYongYe-Chang
before
#1673
now
image
image

and schedule is ok
image

@duanmengkk
Copy link
Member Author

/cc @lonelyCZ

@karmada-bot karmada-bot requested a review from lonelyCZ May 17, 2022 08:59
@duanmengkk
Copy link
Member Author

/assign @RainbowMango

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from rainbowmango after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@duanmengkk
Copy link
Member Author

/close

@karmada-bot
Copy link
Collaborator

@duanmengkk: Closed this PR.

In response to this:

/close

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.

@RainbowMango
Copy link
Member

The latest code judge the health status of the cluster by /readyz and /healthz and ignore the error when get pod and get node,get api-resource ,just log the error and do not fail over.But it does solve the problem #1673

It is #1829. But as we discussed at the meeting, we still need a condition to represent the metadata collection status.

@duanmengkk
Copy link
Member Author

duanmengkk commented May 25, 2022

/reopen ok,i will do it later

@karmada-bot
Copy link
Collaborator

@duanmengkk: Reopened this PR.

In response to this:

/reopen

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.

@karmada-bot karmada-bot reopened this May 25, 2022
@duanmengkk
Copy link
Member Author

image
/cc @dddddai if cluster is oline and healty ,but get pod and get node is failed, should not we handle the error and mark cluster status as unready?

@RainbowMango
Copy link
Member

if cluster is oline and healty ,but get pod and get node is failed, should not we handle the error and mark cluster status as unready?

I don't think so.

@dddddai
Copy link
Member

dddddai commented May 25, 2022

if cluster is oline and healty ,but get pod and get node is failed, should not we handle the error and mark cluster status as unready?

I don't think so.

+1, I think the ready condition should only represent the health check result

@karmada-bot karmada-bot added do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 26, 2022
@duanmengkk
Copy link
Member Author

/hold for e2e test

@karmada-bot karmada-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 27, 2022
@duanmengkk
Copy link
Member Author

/unhold
/cc @RainbowMango

@karmada-bot karmada-bot requested a review from RainbowMango May 28, 2022 13:08
@karmada-bot karmada-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 28, 2022
… supported resources from server

Signed-off-by: duanmeng <[email protected]>
@duanmengkk duanmengkk changed the title Add warn status of the member cluster when failed get all supported resources from server # This is the commit message #1: Add warn status of the member cluster when failed get all supported resources from server May 31, 2022
@duanmengkk duanmengkk changed the title # This is the commit message #1: Add warn status of the member cluster when failed get all supported resources from server Add warn status of the member cluster when failed get all supported resources from server May 31, 2022
@duanmengkk duanmengkk changed the title Add warn status of the member cluster when failed get all supported resources from server Add metadataSufficient status to indicate wether cluster have get all api-resource May 31, 2022
@@ -47,6 +47,9 @@ const (
clusterNotReachableReason = "ClusterNotReachable"
clusterNotReachableMsg = "cluster is not reachable"
statusCollectionFailed = "StatusCollectionFailed"
metadataSufficientMsg = "all APIs installed in the cluster have been obtained"
Copy link
Member

Choose a reason for hiding this comment

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

metadata sufficient not only include APIs, see the condition comments.

@@ -18,6 +18,7 @@ func AddHandlers(h printers.PrintHandler) {
{Name: "Version", Type: "string", Description: "KubernetesVersion represents version of the member cluster."},
{Name: "Mode", Type: "string", Description: "SyncMode describes how a cluster sync resources from karmada control plane."},
{Name: "Ready", Type: "string", Description: "The aggregate readiness state of this cluster for accepting workloads."},
{Name: "MetadataSufficient", Type: "string", Description: "The status indicate that all APIs are obtained"},
Copy link
Member

Choose a reason for hiding this comment

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

Is this used to format the output for kubectl get ?

Is there a test report?

pkg/util/membercluster_client.go Show resolved Hide resolved
Comment on lines +380 to 388
// getAPIEnablements get the list of APIs installed in the member cluster
func getAPIEnablements(clusterClient *util.ClusterClient) ([]clusterv1alpha1.APIEnablement, error) {
// This can return an error *and* the results it was able to find.
// If the length of api resources is not zero,we don't need to fail on the error.
_, apiResourceList, err := clusterClient.KubeClient.Discovery().ServerGroupsAndResources()
if err != nil {
if len(apiResourceList) == 0 {
klog.Errorf("unable to get any supported resources from server. Error: %v.", err)
return nil, err
}
Copy link
Member

Choose a reason for hiding this comment

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

Can you split a PR for the partially APIs? This is our key mission, and shouldn't be blocked by the optional new condition.

Copy link
Member Author

@duanmengkk duanmengkk Jun 3, 2022

Choose a reason for hiding this comment

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

Can you split a PR for the partially APIs?

I am not clearly about what you sayed.Do you mean this PR should not contain e2e test,just focus on the feature of metadataSufficient status.Or is there a problem in line 385 and 386 ?

Copy link
Member Author

@duanmengkk duanmengkk Jun 3, 2022

Choose a reason for hiding this comment

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

Do you mean this pr should not contain e2e test,just focus on the feature of metadataSufficient status

If my understand is right,I will split this PR in three:1. Add metadataSufficient status 2. Add output of metadataSufficient in kubectl get cluster 3.Add new e2e test for metadataSufficient status

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you split a PR for the partially APIs? This is our key mission, and shouldn't be blocked by the optional new condition.

If you do not mind,Can you describe it in Chinese?

Copy link
Member

Choose a reason for hiding this comment

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

I mean the change for func getAPIEnablements is what we urgently needed. We can do it in a separate PR.

For the MetadataSufficient condition, I'm a little bit hesitant as it seems to lack enough benefits to users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I got it

Copy link
Member Author

Choose a reason for hiding this comment

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

A separate PR in #1968
/cc @RainbowMango

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

Join cluster failed(The logic to determine cluster health may not quite right )
6 participants