<p>In Openshift/Kubernetes, I want to test how my application (pod) that consists of 2 containers performs on machines with different number of cores. The machine I have at hand has 32 cores, but I'd like to limit those to 4, 8, 16...</p>

<p>One way is using resource limits on the <strong>containers</strong>, but that would force me to set the ratio on each container; instead, I want to set resource limits for whole pod and let the containers compete on CPU. My feeling is that this should be possible, as the containers could belong to the same cgroup and therefore share the limits from the scheduler POV.</p>

<p>Would the <code>LimitRange</code> on pod do what I am looking for? LimitRange is project/namespace -scoped, is there a way to achieve the same with finer granularity (just for certain pods)?</p>

Radim Vansa
<p>As per <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#resource-requests-and-limits-of-pod-and-container" rel="nofollow noreferrer">documentation</a>: resource constraints are only applicable on container level. You can however define different <code>requests</code> and <code>limits</code> to allow the container to burst beyond the amount defined in requests. But this comes with other implications see <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/resource-qos.md" rel="nofollow noreferrer">Quality of Service</a>. </p>

<p>The reason for this is that some resources such as memory cannot be competed about, as it works for CPU. Memory is either enough or too less. There is no such thing in Kubernetes as shared RAM. (If your are not explicitly call the relevant systemcalls)</p>

<p>May I ask, what the use case for Pod internal CPU competition is?</p>
