<p>I have a node with 6gb memory. I want to run 2 pods on it.</p>

<p><strong>Question 1:</strong><br></p>

<p><a href="https://i.stack.imgur.com/ywRzv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ywRzv.png" alt="enter image description here"></a></p>

<p>POD1 have Request of 4GB and limits of 6GB and POD2 has no limit.<br>
POD1 is working at 4GB and that leaves 2GB of memory free on node.<br>
Can Kubernetes allocate POD2 in this node?<br> or will it be in Pending with <code>You don’t have enough resources</code>?</p>

<p>If Kubernetes run this Pod2 in this node, can POD2 grow into POD1's allocated 4GB memory??<br>
In other words, can Pod2 use memory allocated for Pod1?? </p>

<p><strong>Question 2:</strong><br>
Will this setup(pic2) work?</p>

<p><a href="https://i.stack.imgur.com/C3Fzn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C3Fzn.png" alt="enter image description here"></a></p>

AATHITH RAJENDRAN
<p>The scheduler ensures that, for each resource type, the sum of the resource requests of the scheduled Containers is less than the capacity of the node.</p>

<p>If a Container exceeds its memory limit, it might be terminated. If it is restartable, the kubelet will restart it, as with any other type of runtime failure.
If a Container exceeds its memory request, it is likely that its Pod will be evicted whenever the node runs out of memory.</p>

<blockquote>
  <p>Can Kubernetes allocate POD2 in this node?</p>
</blockquote>

<p>Yes but only if it does not have requests more than 2GB.</p>

<blockquote>
  <p>If Kubernetes run this Pod2 in this node, can POD2 grow into POD1's
  allocated 4GB memory?? In other words, can Pod2 use memory allocated
  for Pod1??</p>
</blockquote>

<p>No.</p>

<blockquote>
  <p>Question 2: Will this setup(pic2) work?</p>
</blockquote>

<p>The scheduler will schedule it. But pod will be evicted if total memory consumption goes beyond the capacity of the node.</p>
