<p>I am using an EKS cluster with 4 nodes. There are multiple applications running in the kubernetes cluster(nearly 30-40 pods) with different cpu and memory requests.</p>
<p>Now I wish to increase the memory of one particular pod, now how to choose what maximum memory I can assign to the pod in my cluster.</p>
<p>My Idea is to get the free memory inside the kubernetes nodes and based on that will decide the maximum memory that I can assign to pod.</p>
<p>I am trying with free command in pods to check the memory available.</p>
<p>How can I get the free memory available in my EKS cluster nodes?</p>
<p>Note: There is no metrics server installed in my EKS cluster</p>

<p>There may be namespace specific limits, which could be lower than whats available at the node level. In this case, you will have to consider the namespace limits.</p>
<p>However, if thats not the case, as a starting value, you may the below command and look at the &quot;Requests&quot; column and choose the request value in your pod that is lower than the available amount shown for your most utilized node.</p>
<pre><code>kubectl get node --no-headers | while read node status; do echo '&gt;&gt;&gt;&gt;  ['$node']'; kubectl describe node $node | grep Resource -A 3 ;done
&gt;&gt;&gt;&gt;  [node-be-worker-1]
  Resource           Requests    Limits
  --------           --------    ------
  cpu                300m (7%)   100m (2%)
  memory             220Mi (2%)  220Mi (2%)
&gt;&gt;&gt;&gt;  [node-be-worker-2]
  Resource           Requests    Limits
  --------           --------    ------
  cpu                200m (5%)   100m (2%)
  memory             150Mi (1%)  50Mi (0%)
&gt;&gt;&gt;&gt;  [node-be-worker-3]
  Resource           Requests    Limits
  --------           --------    ------
  cpu                400m (10%)  2100m (52%)
  memory             420Mi (5%)  420Mi (5%)
&gt;&gt;&gt;&gt;  [node-master-0]
  Resource           Requests    Limits
  --------           --------    ------
  cpu                650m (32%)  100m (5%)
  memory             50Mi (1%)   50Mi (1%)
</code></pre>
<p>Explanation: The command lists all the nodes and loops over to describe the nodes and then filters the lines for &quot;Resource&quot; and prints the string and the next 3 lines.</p>
<p>You should be able to tweak the above command to work for namespace too.</p>
