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

kubelet: fix fail to close kubelet->API connections on heartbeat failure #78016

Merged
merged 1 commit into from May 23, 2019

Conversation

@gaorong
Copy link
Member

@gaorong gaorong commented May 17, 2019

What type of PR is this?
/kind bug

What this PR does / why we need it:
After #63492, we gain the ability to force close connections on heartbeat failure, when heartbeat failed, we invoke closeAllConns and reestablish new connections. But there is a regression imported by #71174, which assign nil to closeAllConns when bootstrapping or client certificate rotation is disabled. So the broken connection cannot be closed correctly and reused by latter request.
This seems a critical problem because the disconnection to API server can cause cluster-level failure. In an edge case, all nodes turn to NotReady status at the same time.
There are some related issues: kubernetes/client-go#374, #65012.

As discussed in kubernetes/client-go#374, another way to fix this is using http/2.0's ping frame to keep connection alive and identify failed connections. but it seems to be a long-term solution.

Which issue(s) this PR fixes:

Special notes for your reviewer:
the default value of connrotation.NewDialer((&net.Dialer{Timeout: 30 * time.Second, KeepAlive: 30 * time.Second}).DialContext) is 30s. jsut align default value from here and it seems work well for a long time.

related integration test is onging: #77957

Does this PR introduce a user-facing change?:

kubelet: fix fail to close kubelet->API connections on heartbeat failure when bootstrapping or client certificate rotation is disabled

@liggitt @smarterclayton @lavalamp @roycaihw @jfoy @hzxuzhonghu

@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented May 17, 2019

Hi @gaorong. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

Loading

@mattjmcnaughton
Copy link
Contributor

@mattjmcnaughton mattjmcnaughton commented May 17, 2019

/ok-to-test

Loading

cmd/kubelet/app/server.go Show resolved Hide resolved
Loading
@lavalamp
Copy link
Member

@lavalamp lavalamp commented May 17, 2019

Loading

@gaorong gaorong force-pushed the fix-closeAllConns branch 2 times, most recently from f947183 to 6ecd312 May 21, 2019
@gaorong
Copy link
Member Author

@gaorong gaorong commented May 21, 2019

the CI is green now

Loading

cmd/kubelet/app/server.go Show resolved Hide resolved
Loading
@gaorong gaorong force-pushed the fix-closeAllConns branch from 6ecd312 to 1d07d30 May 23, 2019
@liggitt
Copy link
Member

@liggitt liggitt commented May 23, 2019

/kind bug
/priority important-soon
/lgtm
/approve

Loading

@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented May 23, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gaorong, liggitt

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

Loading

@liggitt
Copy link
Member

@liggitt liggitt commented May 23, 2019

thanks. once this merges, can you pick it to the release-1.14 branch with hack/cherry_pick_pull.sh?

Loading

@k8s-ci-robot k8s-ci-robot merged commit 1fba888 into kubernetes:master May 23, 2019
20 checks passed
Loading
@tedyu
Copy link
Contributor

@tedyu tedyu commented May 23, 2019

In the description:

ping fame -> ping frame

Loading

@gaorong gaorong deleted the fix-closeAllConns branch May 24, 2019
@gaorong
Copy link
Member Author

@gaorong gaorong commented May 24, 2019

thanks. once this merges, can you pick it to the release-1.14 branch with hack/cherry_pick_pull.sh?

sure, I'll work on this.

Loading

@chestack
Copy link
Contributor

@chestack chestack commented Nov 5, 2019

how about kube-proxy which has the name issue. Is there any plan to fix it.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants