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
Resource Quotas: Possibility to not enforce limits.cpu per pod #116063
Comments
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. |
Did you try |
I considered Some context: |
cgroups are local to the node running the pod, but pods in a namespace are not all on the same node. That means real time CPU usage would have to be reported back into the API, observed by other nodes, and cgroup rules updated in response, at high frequency, for this to work. You need some indicator on each pod how the CPU limits should be set to inform the node how to set its cgroups. |
Why not distributing available CPU to the set of non-limited pods on each node relative to the number of non-limited pods? |
/sig node |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
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. |
What would you like to be added?
Currently, for cpu (and memory) resources, ResourceQuotas enforce that every (new) pod in that namespace sets a limit for that resource.
There should be a new option for the limits.cpu ResourceQuota at namespace level:
enforceLimitPerPod: true (default) / false
If false, it's optional to define limits.cpu for each pod in this namespace.
limits.cpu
of the namespace minuslimits.cpu
of each pod (where defined) should be used to limit CPU usage across all other pods in this namespace.Why is this needed?
According to https://kubernetes.io/docs/concepts/policy/resource-quotas/,
you can limit the total sum of compute resources that can be requested in a given namespace. limits.cpu for the namespace ist computed as follows: Across all pods in a non-terminal state, the sum of CPU limits cannot exceed this value.
This is a problem with workloads which have a low base CPU usage with short cpu spikes randomly distributed across pods and time. A lot of assigned CPU is wasted in such case.
For such workload scenarios, it would make more sense to limit only the sum of CPU usage of all pods in the namespace instead of limiting each pod separately.
Example:
limits.cpu namespace: 8
16 containers with limits.cpu 500m
Each of these containers are limited to 500m CPU which could affect application performance negatively. If specification of limits.cpu is not enforced in this namespace, each pod could use up to 7.985 CPU If each other pod in the observed timeslot currently has a CPU usage of 1m.
The text was updated successfully, but these errors were encountered: