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

Timeout on instances.NodeAddresses cloud provider request #62543

Conversation

ingvagabund
Copy link
Contributor

@ingvagabund ingvagabund commented Apr 13, 2018

What this PR does / why we need it:

In cases the cloud provider does not respond before the node gets evicted.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

stop kubelet to cloud provider integration potentially wedging kubelet sync loop

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 13, 2018
@ingvagabund
Copy link
Contributor Author

@sjenning

@ingvagabund ingvagabund force-pushed the timeout-on-cloud-provider-request branch 2 times, most recently from 0b6b6ff to 55e0b31 Compare April 13, 2018 14:38
@derekwaynecarr
Copy link
Member

a call to the cloud provider wedging the kubelet is a problem. i wish the cloud provider apis had a defined timeout, but i recognize that is harder to push out.

@derekwaynecarr
Copy link
Member

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 18, 2018
Copy link
Member

@derekwaynecarr derekwaynecarr left a comment

Choose a reason for hiding this comment

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

can you clarify on how 3m default was selected?

klet.cloudproviderRequestParallelism = make(chan int, 1)
klet.cloudproviderRequestSync = make(chan int)
// TODO(jchaloup): Make it configurable via --cloud-provider-request-timeout
klet.cloudproviderRequestTimeout = 3 * time.Minute
Copy link
Member

Choose a reason for hiding this comment

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

how did you settle on 3m?

i feel like this should be less than the heartbeat status interval

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, either 10s (status frequency) or 30s (10s less than the 40s timeout before the node is marked NotReady. I favor 10s.

There is also the fundamental issue of do we need to do this call on every status update. Seems like this information (hostame, internal ip, external ip) is pretty static.

Copy link
Contributor Author

@ingvagabund ingvagabund Apr 19, 2018

Choose a reason for hiding this comment

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

how did you settle on 3m?

for testing purposes. I plan to make the timeout configurable. Or does it make more sense to hardcode it? 10s seems good.

select {
case <-kl.cloudproviderRequestSync:
case <-time.After(kl.cloudproviderRequestTimeout):
err = fmt.Errorf("Timeout after %v", kl.cloudproviderRequestTimeout)
Copy link
Contributor

Choose a reason for hiding this comment

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

Might put this at V(2) and change to "timeout after %v trying to get instance information from cloud provider"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

glog.V(2).Infof("timeout after %v trying to get instance information from cloud provider", kl.cloudproviderRequestTimeout)
return nil

?

Copy link
Contributor

Choose a reason for hiding this comment

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

looks good

Copy link
Contributor

Choose a reason for hiding this comment

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

actually nevermind this whole thing. i didn't see the block after this and that we were just setting err here, not returning it.

@ingvagabund ingvagabund force-pushed the timeout-on-cloud-provider-request branch from 55e0b31 to 478e3b8 Compare April 19, 2018 16:38
@ingvagabund ingvagabund changed the title WIP: Timeout on instances.NodeAddresses cloud provider request Timeout on instances.NodeAddresses cloud provider request Apr 19, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 19, 2018
@ingvagabund
Copy link
Contributor Author

ingvagabund commented Apr 19, 2018

@derekwaynecarr @sjenning changed the timeout to 10 seconds.

@sjenning
Copy link
Contributor

@ingvagabund you might need to rebase this to resolve the test failures. The tests don't seem to be broken across all PRs, but they are repeatably broken for this PR.

@ingvagabund ingvagabund force-pushed the timeout-on-cloud-provider-request branch from 478e3b8 to d34b50d Compare April 20, 2018 09:58
@ingvagabund
Copy link
Contributor Author

Just rebasing. I will check the failed tests afterwards.

@ingvagabund
Copy link
Contributor Author

/test pull-kubernetes-bazel-test

@ingvagabund
Copy link
Contributor Author

No idea why the bazel fails:

W0420 11:18:29.104] TIMEOUT: //pkg/kubelet:go_default_test (Summary)
--
  | W0420 11:18:29.104]       /bazel-scratch/.cache/bazel/_bazel_root/e9f728bbd90b3fba632eb31b20e1dacd/execroot/__main__/bazel-out/k8-fastbuild/testlogs/pkg/kubelet/go_default_test/test_attempts/attempt_1.log
  | W0420 11:18:29.104]       /bazel-scratch/.cache/bazel/_bazel_root/e9f728bbd90b3fba632eb31b20e1dacd/execroot/__main__/bazel-out/k8-fastbuild/testlogs/pkg/kubelet/go_default_test/test_attempts/attempt_2.log
  | W0420 11:18:29.104]       /bazel-scratch/.cache/bazel/_bazel_root/e9f728bbd90b3fba632eb31b20e1dacd/execroot/__main__/bazel-out/k8-fastbuild/testlogs/pkg/kubelet/go_default_test/test.log
  | W0420 11:18:29.104] INFO: From Testing //pkg/kubelet:go_default_test:
  | W0420 11:18:29.132] INFO: Elapsed time: 987.597s, Critical Path: 908.95s
  | W0420 11:18:29.133] INFO: Build completed, 1 test FAILED, 9276 total actions
  | I0420 11:18:29.233] ==================== Test output for //pkg/kubelet:go_default_test:

Any hints what to look for?

@ingvagabund
Copy link
Contributor Author

Reproducible locally by running bazel test --config=unit --build_tag_filters=-e2e,-integration --test_tag_filters=-e2e,-integration --flaky_test_attempts=3 //pkg/kubelet:go_default_test

@ingvagabund
Copy link
Contributor Author

kubelet_node_status_test.go:TestNodeStatusWithCloudProviderNodeIP is failing

@ingvagabund ingvagabund force-pushed the timeout-on-cloud-provider-request branch from d34b50d to 61efc29 Compare April 23, 2018 11:30
@ingvagabund
Copy link
Contributor Author

/test pull-kubernetes-integration

@ingvagabund
Copy link
Contributor Author

/test pull-kubernetes-local-e2e-containerized

@ingvagabund
Copy link
Contributor Author

I0419 17:05:31.776] Unable to find image 'k8s.gcr.io/kubelet:latest' locally

Most likely the pull-kubernetes-local-e2e-containerized due to that.

@ingvagabund
Copy link
Contributor Author

@sjenning @derekwaynecarr PTAL

@dims
Copy link
Member

dims commented Apr 23, 2018

@ingvagabund you can safely ignore the pull-kubernetes-local-e2e-containerized job. it's not fully baked yet. (it's not a required job)

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 23, 2018

@ingvagabund: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-local-e2e-containerized 61efc29 link /test pull-kubernetes-local-e2e-containerized

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@ingvagabund
Copy link
Contributor Author

@dims yeah, I checked the TestGrid and other PRs and it seems to be so true :) Thanks for verifying that.

@derekwaynecarr
Copy link
Member

/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 Apr 23, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: derekwaynecarr, ingvagabund

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 Apr 23, 2018
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 5b77996 into kubernetes:master Apr 23, 2018
@ingvagabund ingvagabund deleted the timeout-on-cloud-provider-request branch April 24, 2018 10:30
rfranzke added a commit to gardener/gardener that referenced this pull request Jul 31, 2018
On kubelet start-up some functions to set the node status are generated. One of those functions propagates the node addresses into the `Node` object the kubelet is responsible for (`.status.addresses`).
The kube-apiserver uses these addresses to talk to the actual node.

To identify the IP address of the node the kubelet communicates with the cloud provider. kubernetes/kubernetes#62543 introduced a timeout of 10s when trying to connect to the cloud. In case the IP cannot
be determined within 10s, the `Node` object does not report an `InternalIP` address.

Consequently, the kube-apiserver will never be able to talk to that node; particularly VPN won't work in case the vpn-shoot pod is scheduled on it.

Once the connection failed, it is never retried, and only a kubelet process restart can trigger it again. Hence, our kubelet monitoring script will now do the same when it cannot find an `InternalIP` or an `ExternalIP`
address on the `Node` object.

closes #283
richardyuwen pushed a commit to richardyuwen/gardener that referenced this pull request Mar 26, 2019
On kubelet start-up some functions to set the node status are generated. One of those functions propagates the node addresses into the `Node` object the kubelet is responsible for (`.status.addresses`).
The kube-apiserver uses these addresses to talk to the actual node.

To identify the IP address of the node the kubelet communicates with the cloud provider. kubernetes/kubernetes#62543 introduced a timeout of 10s when trying to connect to the cloud. In case the IP cannot
be determined within 10s, the `Node` object does not report an `InternalIP` address.

Consequently, the kube-apiserver will never be able to talk to that node; particularly VPN won't work in case the vpn-shoot pod is scheduled on it.

Once the connection failed, it is never retried, and only a kubelet process restart can trigger it again. Hence, our kubelet monitoring script will now do the same when it cannot find an `InternalIP` or an `ExternalIP`
address on the `Node` object.

closes gardener#283
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants