<p>You should be able to use the flag <code>spec.containers[].resources.limits.cpu</code> to set your desired state on a deployment.</p>

<p>The official docs <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" rel="nofollow noreferrer">here</a> and <a href="https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/" rel="nofollow noreferrer">here</a> have some examples of how to specify this in the yaml.  You can set a global default along with min/max limits:</p>

<pre><code>spec:
  limits:
  - default:
      cpu: 1000m
    defaultRequest:
      cpu: 300m
  - min:
      cpu: 300m
  - max:
      cpu: 1000m
</code></pre>

CC BY-SA 4.0
2019-12-27T17:57:47.237Z
Unfortunately, this does not at all answer my question. Might be a misunderstanding.
Johannes
CC BY-SA 4.0
2019-12-27T18:05:00.780Z
@Johannes: What is your question then?  The above shows how you can set a default CPU request above the minimum (i.e. over-committing).
Wesley Rolnick
CC BY-SA 4.0
2019-12-26T15:53:13.367Z
2019-12-27T15:56:51.180Z
2019-12-27T15:56:51.180Z
Wesley Rolnick
<p>Let’s assume the following scenario: </p>

<p>I have a cluster with 100 CPU cores and 100 Pods each having a request of 1 CPU. </p>

<p>If I schedule the 101st Pod if a request of 1 CPU this will no longer be schedulable, as per my understanding.</p>

<p>Now, further assume that I as cluster operator have observed that pods on average only consume .3 CPU in reality. It would be beneficial if scheduling further pods instances was possible.</p>

<p>Can I somehow apply a global correction factor that disregards CPU requests to some degree and allows me to overcommit the available resources?</p>

<kubernetes>
Overcommiting CPU Resources in Kubernetes
Johannes
# Overcommiting CPU Resources in Kubernetes

(Asked by: username_0 on 2019-12-12)

Let’s assume the following scenario:

I have a cluster with 100 CPU cores and 100 Pods each having a request of 1 CPU.

If I schedule the 101st Pod if a request of 1 CPU this will no longer be schedulable, as per my understanding.

Now, further assume that I as cluster operator have observed that pods on average only consume .3 CPU in reality. It would be beneficial if scheduling further pods instances was possible.

Can I somehow apply a global correction factor that disregards CPU requests to some degree and allows me to overcommit the available resources?

**Tags:** kubernetes


---

## 1 answers

### Answer by username_1 on 2019-12-26. Score: 1

You should be able to use the flag spec.containers[].resources.limits.cpu to set your desired state on a deployment.
The official docs here and here have some examples of how to specify this in the yaml.  You can set a global default along with min/max limits:
spec:
  limits:
  - default:
      cpu: 1000m
    defaultRequest:
      cpu: 300m
  - min:
      cpu: 300m
  - max:
      cpu: 1000m

> **Comments:**
> **username_0**: Unfortunately, this does not at all answer my question. Might be a misunderstanding.  
> **username_1**: @username_0: What is your question then?  The above shows how you can set a default CPU request above the minimum (i.e. over-committing).  

---

