<p>I have a java based application consisting of several pods (lets say 4) which is licensed by the sum of millicores (lets say we have purchased 2000mC of licenses). The application is running on a cluster host with 4000mC to support the memory required for the application. The application is bursty so each pod will want to use 2000mC at some point in time, but not at the same time. If the cpu limit is set to 2000mC per pod then over 4 pods our license liability would be 8000mC although in reality the host capacity would limit it to 4000mC. This is still double the licenses we have paid for. If we limit each pod to 500mC to ensure we never exceed 2000mC and stay within our license limit, the pods are under-resourced.</p>
<p>Is there a way to limit the CPU for a group of pods to allow any single pod to burst to the maximum limit while collectively not allowing them to exceed the maximum?</p>

D.Baillie
<p>A good strategy here would be to play with both <strong>requests</strong> and <strong>limit</strong> parameter of resources.</p>
<p>As an example for your case, you can use following configuration</p>
<ul>
<li><code>resources.requests.cpu</code> - 750mC</li>
<li><code>resources.limits.cpu</code> - 2000mC</li>
</ul>
<p>This will allocate 3000m (740 x 4) CPU in the node, allowing additional 1000mC for CPU to burst.</p>
<p>Reference - <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#motivation-for-cpu-requests-and-limits" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#motivation-for-cpu-requests-and-limits</a></p>
