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

Improve kops get instances when api is unavailable #9938

Merged
merged 1 commit into from
Sep 19, 2020

Conversation

olemarkus
Copy link
Member

When the api is unavailable, kops will say all the nodes have not yet joined the cluster. That is not the case simply because e.g the admin credentials have been expired. This PR makes it a bit more clear that we cannot know the node name when the API is unavailable.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 15, 2020
@olemarkus
Copy link
Member Author

/cc @hakman

@k8s-ci-robot k8s-ci-robot requested a review from hakman September 15, 2020 08:15
Copy link
Contributor

@rdrgmnzs rdrgmnzs left a comment

Choose a reason for hiding this comment

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

LGTM only have 1 nit.

nodeList, err := k8sClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{})
if err != nil {
klog.V(2).Infof("error listing nodes: %v", err)
klog.Warningf("error listing nodes. Cannot determine node status: %v", err)
emptyNodeName = "APIUnavailable"
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: Should we make this a bit more clear that it's the k8s API that is unavailable since we normally deal with both the k8s api and cloud provider API?

Copy link
Member Author

Choose a reason for hiding this comment

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

Any suggestion on the wording? don't think we can make the node name more verbose at least.

@rifelpet
Copy link
Member

Maybe it makes more sense for the NODE-NAME column to use an empty string or N/A for every value? and the klog.Warningf should make it clear that the API is unavailable if err doesn't provide enough info itself. I think that would be more intuitive than having a column of APIUnavailable values for the NODE-NAME column. If the API server is unavailable then we will definitely not know any node names... maybe we remove the column altogether if thats feasible.

@olemarkus olemarkus force-pushed the kgi-fix-unavailable-api branch 2 times, most recently from a68f498 to 1c6093b Compare September 19, 2020 06:41
When the api is unavailable, kops will say all the nodes have not yet
joined the cluster. That is not the case simply because e.g the admin
credentials have been expired. This PR makes it a bit more clear that we
cannot know the node name when the API is unavailable.
@olemarkus olemarkus force-pushed the kgi-fix-unavailable-api branch from 1c6093b to 31ee079 Compare September 19, 2020 06:44
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 19, 2020
@hakman
Copy link
Member

hakman commented Sep 19, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman, olemarkus

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 19, 2020
@hakman
Copy link
Member

hakman commented Sep 19, 2020

/retest

@k8s-ci-robot k8s-ci-robot merged commit d83f8e5 into kubernetes:master Sep 19, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants