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
fix wrong NumCPU in kube-proxy under static CPU policy #99613
Conversation
Welcome @xh4n3! |
@xh4n3: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @xh4n3. 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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
/test pull-kubernetes-e2e-kind-ipv6 |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. |
Signed-off-by: xh4n3 <xyn1016@gmail.com>
@@ -185,6 +186,10 @@ func getProxyMode(proxyMode string, kcompat winkernel.KernelCompatTester) string | |||
return proxyModeUserspace | |||
} | |||
|
|||
func detectNumCPU() int { | |||
return goruntime.NumCPU() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this OK? Does it need followup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I put a comment in this line or skip calling getConntrackMax() by judging runtime.GOOS at
kubernetes/cmd/kube-proxy/app/server.go
Lines 671 to 677 in d6bc98f
// Tune conntrack, if requested | |
// Conntracker is always nil for windows | |
if s.Conntracker != nil { | |
max, err := getConntrackMax(s.ConntrackConfiguration) | |
if err != nil { | |
return err | |
} |
In fact no windows will come to this point.
Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thockin, xh4n3 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 |
/retest |
1 similar comment
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
@thockin can I have this commit backport to 1.20 or earlier version? |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixes wrong NumCPU used in conntrack-max calculation in kube-proxy on nodes with static CPU policy turned on.
Which issue(s) this PR fixes:
Fixes #99225
Special notes for your reviewer:
kube-proxy will try look up CPU core number in Node resource info to calculate conntrack-max, only if failed, it will then lookup through golang's
runtime.NumCPU()
.Does this PR introduce a user-facing change?