<p>In addition to the good answer by @therianthropie, here are useful notes to help you understand the situation better.:</p>

<ul>
<li>You can set requests and limits very arbitrarily (and yes, as fractions of a CPU and very small amounts of memory).</li>
<li>Kubernetes will <em>not</em> do its job well if you don't get real values for these.</li>
<li>If you under-shoot your request, kubernetes will schedule a lot of apps without requesting enough resources and you'll have problems with the CPU/memory/disk, and so on.</li>
<li>If you over-shoot your request a lot, your kubernetes nodes may be doing virtually nothing.</li>
<li>Some apps are very  CPU bound, some memory bound, some use virtually no resources.  So, you really can't guess.</li>
<li>Prometheus is a popular tool that you can install into kubernetes with basically a single command.</li>
<li>You can chart things in grafana.</li>
<li>So, then you choose your arbitrary  values, then watch the charts as you use the app, and then you can adjust them to something sane / useful so kubernetes can do its job well.  You can also set alerts with something called alert manager if your values are too ridiculous (it's a good idea once you're ready).</li>
<li>Note - requests are what kubernetes allocates for your pod.  Limits are the max resources your pod can spike to when it needs them. There is a general assumption that not all pods will spike in usage at once / or over a long term or else this idea would not work.</li>
</ul>

CC BY-SA 4.0
2020-04-10T03:03:31.170Z
2020-04-10T03:03:31.170Z
John Humphreys
<p>No, you can set requests and limits with fractions of vCPUs.
For example, every pod has a request/limit of 100m (1/10 of a CPU). 
This means 20 pods would need 2 CPUs in total. </p>

CC BY-SA 4.0
2020-04-09T19:21:08.517Z
2020-04-09T19:21:08.517Z
therianthropie
<p>Let's suppose i have 5 k8s nodes with 2 cpu on each node.</p>

<p>This mean i have 10 cpus.</p>

<p>Now let's suppose i want to deploy a very small and basic application with 20 replicas.</p>

<p>Is there a limitation on k8s that will allow only one pod for one cpu and reject 10/20 replicas ?</p>

<p>Thanks</p>

<kubernetes>
Run more pods than node's CPU with k8s
Bob5421
# Run more pods than node's CPU with k8s

(Asked by: username_0 on 2020-04-06)

Let's suppose i have 5 k8s nodes with 2 cpu on each node.

This mean i have 10 cpus.

Now let's suppose i want to deploy a very small and basic application with 20 replicas.

Is there a limitation on k8s that will allow only one pod for one cpu and reject 10/20 replicas ?

Thanks

**Tags:** kubernetes


---

## 2 answers

### Answer by username_1 on 2020-04-10. Score: 1 | Accepted answer

In addition to the good answer by @username_2, here are useful notes to help you understand the situation better.:

* You can set requests and limits very arbitrarily (and yes, as fractions of a CPU and very small amounts of memory).
* Kubernetes will *not* do its job well if you don't get real values for these.
* If you under-shoot your request, kubernetes will schedule a lot of apps without requesting enough resources and you'll have problems with the CPU/memory/disk, and so on.
* If you over-shoot your request a lot, your kubernetes nodes may be doing virtually nothing.
* Some apps are very CPU bound, some memory bound, some use virtually no resources. So, you really can't guess.
* Prometheus is a popular tool that you can install into kubernetes with basically a single command.
* You can chart things in grafana.
* So, then you choose your arbitrary values, then watch the charts as you use the app, and then you can adjust them to something sane / useful so kubernetes can do its job well. You can also set alerts with something called alert manager if your values are too ridiculous (it's a good idea once you're ready).
* Note - requests are what kubernetes allocates for your pod. Limits are the max resources your pod can spike to when it needs them. There is a general assumption that not all pods will spike in usage at once / or over a long term or else this idea would not work.


---

### Answer by username_2 on 2020-04-09. Score: 0

No, you can set requests and limits with fractions of vCPUs.
For example, every pod has a request/limit of 100m (1/10 of a CPU).
This means 20 pods would need 2 CPUs in total.


---

