<p>Are Kubernetes CPU limits "hard" limits?</p>

<p>Say I have a node with 1 CPU with two pods scheduled and running/ready/active, each with <code>requests.limits.cpu</code> of 500m. Pod A uses up 1 CPU for a while--this is normal/allowed. Eventually, pod B wants some CPU. Will Kubernetes (or Linux) make sure that pod B can get the .5 CPU it asks for?</p>

<h2>Update on Thu Jun 23 16:55:25 UTC 2016</h2>

<p>I'm still looking for a definitive answer, but it sounds like these may be hard limits in Linux/Docker. <code>@danielmartins</code> <a href="https://kubernetes.slack.com/archives/kubernetes-users/p1466620520005883" rel="nofollow">wrote this</a> in the <a href="https://kubernetes.slack.com" rel="nofollow">k8s slack channel</a>:</p>

<blockquote>
  <p>I believe you can find this out by running <code>docker inspect</code> on the containers in which you set the limits. Checking one of my containers, I see that Kubernetes set <code>CpuPeriod</code>, <code>CpuQuota</code> for them. The Docker docs (<a href="https://docs.docker.com/engine/reference/run/" rel="nofollow">https://docs.docker.com/engine/reference/run/</a>) mention the CFS documentation (<a href="https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt" rel="nofollow">https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt</a>), and from the information there, it seems that these are hard limits</p>
</blockquote>

<p>Kubernetes just manages the containers. As far as I know, it is actually the container engine (Docker, rkt) which implements the CPU limitation. That limitation is not a hard limit, as you already observed. but rather a percentage of the available resources. </p>

<p>Kubernetes (if set up with monitoring for this purpose), takes the used resource values and uses them to determine if you need a new pod (assuming you have set up some auto scaling). Kubernetes can not rate limit the existing pod since it is not actually running the containers in the pod.</p>
