Pod IP CIDR limit with a few pods

Cluster information:

Kubernetes version: 1.16.13-gke.1
Cloud being used: GKE
Installation method: Google deployment
Host OS: COS from Google

Hello,

I have a question about IP addresses and pods. Yesterday I got an error telling me that the CIDR is too small. The CIDR has 2048 IP addresses and there are less than 30 pods on that cluster, so I want to know how IP addresses works, in order to know if maybe I’ve missconfigured something:
image (1)

Thanks!

Each node carves off a chunk of IPs. How big that chunk is is controlled by the “maximum pods per node” fields (a cluster default and a per-pool override). My guess is that you have the default 110, which allocates a /24 (256 IPs) per node, and you are trying to resize from 8 to 12 nodes?

Hello,

I think that I’m starting to understand. Yes, I’ve the default setting of 110 max pods per node, and that’s what I didn’t know: K8s preallocates those ip addresses. Also the nodes number is 8 so surely is what you say. I’ll reduce that number, because the node that has the higher number of pods, have less than 20.

Thanks for all your help