-2

While reading Google gke docs I found the option to create a network per cluster and I am wondering whether it's a good idea to do that from the network perspective.

I found it useful in my scenario since I want to use a shared VPC and connect all projects to it and start creating gke clusters from all projects, but faced a limitation by google of allowing a maximum of 30 secondary ranges by subnet which means that a subnet can host like a max of 15 clusters which requires creating more subnets to allow for creating more secondary ranges.

Should I go along with a subnet per gke cluster way or is there a better approach to follow?

Naran
  • 83
  • 6

1 Answers1

1

For VPC Native Clusters,

The cluster uses three subnet IP address ranges that must each be unique within the same cluster:

  • It uses the subnet's primary IP address range for all node IP addresses.
  • It uses one secondary IP address range for all Pod IP addresses. If you use a dual-stack networking, GKE uses a separate range for the Pods. Pods get their IPv6 address from the primary IP address range similar to the nodes.
  • It uses another secondary IP address range for all Service (cluster IP) addresses.

The maximum number of Secondary IP ranges that can be created per subnet is 30.

So you are correct, you can only get 15 clusters in each primary subnet. If you need more than 15 clusters then there's no other way but to create more subnets until you meet your requirement. You should also consider your quota limit with the number of Subnetwork ranges per VPC network that you can create by checking it through IAM > Quotas in the Google Cloud Console.

James S
  • 1,181
  • 1
  • 7