<p>I am trying to deploy an application into my Kubernetes cluster. It is a multi node cluster. There are <code>3 m4.2xlrge</code> aws instances.</p>

<pre><code>m4.2xlarge
vCPU :- 8
Memory :- 32
</code></pre>

<p>Now, in my <code>deployment.yaml</code> file for that service, I have mentioned</p>

<pre><code>limit:
  cpu: 11
request:
  cpu: 11
</code></pre>

<p>It is giving error, <code>insufficient cpu</code> and container is not scheduling. I have already <code>(8*3)=24</code> CPU resources available and I requested for <code>11</code> CPU out of it. It should share the CPU resource across nodes. Is the <code>limit</code> and <code>request</code> CPU is applicable for the containers per node? That means, should I have atleast <code>11</code> CPU per aws instance?</p>

<p>A Pod is scheduled on a single Node.  The resource <code>requests:</code> help decide where it can be scheduled.  If you say <code>requests: {cpu: 11}</code> then there must be some single node with 11 (unreserved) cores available; but if your cluster only has 8-core m4.2xlarge nodes, no single node will be able to support this.  Kubernetes can’t “aggregate” cores across nodes in any useful way at this level.</p>

<p>If you’re requesting a lot of CPU because your process has a lot of threads to do concurrent processing, consider turning the number of threads down (maybe even to just 1) but then changing the <code>replicas:</code> in a Deployment spec to run many copies of it.  Each individual Pod will get scheduled on a single Node, but with many replicas you’ll get many Pods which can be spread across the three Nodes.</p>

<p>If your process really needs more than 8 cores to run, then you need individual systems with more than 8 cores; consider an m4.4xlarge (same RAM-to-CPU ratio) or a c4.4xlarge (same total RAM, twice the cores).</p>
