Reputation: 471
I am going through the doc on creating routes-based clusters in GKE.
In the Pod address range section, it says the following:
A routes-based cluster has a range of IP addresses that are used for Pods and Services. Even though the range is used for both Pods and Services, it is called the Pod address range. The last /20 of the Pod address range is used for Services. A /20 range has 2^12 = 4096 addresses. So 4096 addresses are used for Services, and the rest of the range is used for Pods.
What does it mean to say "rest of the range is used for Pods?" Just like 4096 addresses are used for Services, then how many addresses are used for pods?
Upvotes: 0
Views: 299
Reputation: 3772
The maximum number of nodes, Pods, and Services for a given GKE cluster is determined by the size of the cluster subnet and the size of the Pod address range. You cannot change the Pod address range size after you create a cluster.
Similarly, if you set the default maximum Pods to 8 and the cluster's secondary IP address range for Pods to /21, Kubernetes assigns a /28 CIDR range to nodes. This allows a maximum of 2(28-21) = 27 = 128 nodes on the cluster.
Suppose you plan to create a 900-node cluster. Then you need 900 x 256 = 230,400 addresses for Pods. Now suppose you have a /14 Pod address range. A /14 range has 2^18 = 262,144 addresses. Subtract the 4096 addresses used for Services, and you get 258,048 pod addresses, which is sufficient for 900 nodes.
For more information refer to these Defaults and limits for range sizes and Configure maximum Pods per node. You can also Refer to this blog by Jayendra's Cloud Certification Blog
Upvotes: 2