<p>I have setup a new subnet in my shared VPC for GKE autopilot as the following:</p>
<pre><code>node ip: 10.11.1.0/24
first secondary ip: 10.11.2.0/24
second secondary ip: 10.11.3.0/24
</code></pre>
<p>I tried to test it by running simple nginx images with 30 replicas.</p>
<p>based on my understanding:</p>
<pre><code>I have 256 possible node IP
I have 256 possible pod IP
I have 256 possible service IP
</code></pre>
<p>after deploying, somehow my k8s are stuck with only 2 pods deployed and running. the rest is just in pending state with error code:<code>IP_SPACE_EXHAUSTED</code></p>
<p>my question is how come? I still have plenty IP address, this is fresh deployed kubernetes cluster.</p>

V Adhi Pragantha
<p><a href="https://cloud.google.com/kubernetes-engine/docs/how-to/flexible-pod-cidr#cidr_settings_for_clusters" rel="nofollow noreferrer">Autopilot sets &quot;max pods per node&quot; to 32</a>.  This results in a /26  (64 IP addresses) being assigned to each Autopilot node from the Pod secondary IP range.  Since your Pod range is a /24, this means your Autopilot cluster can support a max of 4 nodes.</p>
<p>By default, Autopilot clusters start with 2 nodes (one runs some system stuff).  Looks like your pods did not fit on either of these nodes, so Autopilot provisioned new nodes as required.  Generally, Autopilot tries to find the best fit node sizes for your deployments and in this case looks like you ended up with a pod per node.</p>
<p>I'd recommend a /17 or a /16 for your Pod range to maximize the number of nodes.</p>
