<p>I am trying to get the maximum capacity of pod per node. I am running <code>kubectl describe node nodename</code> and trying to grep the pods limit in capacity section. Any help would be appreciated. The output is like this.</p>
<pre><code>Capacity:
  attachable-volumes-azure-disk:  8
  cpu:                            4
  ephemeral-storage:              129900528Ki
  hugepages-1Gi:                  0
  hugepages-2Mi:                  0
  memory:                         16393308Ki
  pods:                           110

</code></pre>

<p>if you want to use just native ooptions of kubectl command</p>
<p><code>kubectl get nodes &lt;nodename&gt; -o jsonpath='{.status.capacity.pods}{&quot;\n&quot;}'</code></p>
<p>If you dont need trailing newline character after the output:</p>
<p><code>kubectl get nodes &lt;nodename&gt; -o jsonpath='{.status.capacity.pods}'</code></p>
