-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
func NumCPU() fails to return correct cpus when using cgroups2 #9665
Comments
From gke 1.26 cgroupsv2 will be made default. So this is an important fix that needs to be done. |
/triage accepted |
Hi maintainers (cc @longwuyuan )! I'm a CS student at the University of Texas at Austin. I'm taking a class focusing on open-source software and virtualization at the moment. One part of the course is making open source contributions. I'd like to work on this issue. The class requires that we ask the maintainers and get an OK to work on the issue before it can be counted for credit in the class. Would it be possible for me and my partner in the class to work on this issue? |
@nickorlow you were misinformed. OSS projects don't require seeking permission to work on issues. OSS projects welcome improvements. |
Hi! Thanks for your response @longwuyuan ! The requirement to ask the maintainers is a requirement of the class we're in. |
No such thing but wait for comments from others i guess. Surprised you did not get info on normally how things work in communities. This is dev guide https://kubernetes.github.io/ingress-nginx/developer-guide/getting-started/ |
Assuming you are not aware, helpful things to do is talk in kubernetes.slack.com (register at slack.k8s.io) and submit a PR for your improvement code. Others review and comment and next steps are based on reviews. |
Thanks for the information! I'll ask around on the slack. The syllabus for my class just says that we need a maintainer to comment on the issue saying that we can work in it. |
@nickorlow I responded in slack and assigned this task to you. |
As the default configuration causes all the cores to be used by the container on a cluster using cgroups2. |
@nickorlow |
Yes, should push something in the next few days |
We have currently 400+ ingress controller on newly upgraded 1.25 Azure AKS clusters waiting for a solution. |
WA is to set it in configmap |
I'm mostly done. The documentation for cgroups 2 states that the file format for the |
Use cgroups2 if available or else fall back to cgroups1. |
This issue has not been updated in over 1 year, and should be re-triaged. You can:
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/ /remove-triage accepted |
/triage accepted |
What happened:
Installing ingress-nginx helm chart into k8s 1.24 with base OS ubuntu 22 (cgroups v2) doensn't generate correct worker_process based on k8s resources, instead it get max cpu cores of the node.
On previous ubuntu 20 (cgroups v1) the
/etc/nginx/nginx.conf
file into the container got configured toOn ubuntu 22 base os (groups v2) the
/etc/nginx/nginx.conf
file into the container gets configured all the posible cores in the node (64 in my case),What you expected to happen:
I think the way is calculated only works for cgroup v1 and not for cgroup v2 returning max cpus when not finding cgrup v1 files:
https://github.com/kubernetes/ingress-nginx/blob/main/pkg/util/runtime/cpu_linux.go#L38-L54
func NumCPU()
uses cgroup v1 paths to calculate:In cgroup v2, this was replaced by one file containing the previous 2 values from v1
NGINX Ingress controller version ):
Kubernetes version: v1.24.6
Environment:
uname -a
): Linux worker-4 5.15.0-60-generickubectl version
1.24.6How to reproduce this issue:
nginx controller being executed in any node with cgroups 2 and limited by 1 CPU
The text was updated successfully, but these errors were encountered: