I was doing some research on GKE, and was trying to understand the way the pod networking was set up. It surprised me to see that pods received IPs in the GKE cluster's subnet, and that those IPs were addressable from other devices in the VPC.

I was looking at AKS documentation and found this article: https://docs.microsoft.com/en-us/azure/aks/configure-kubenet

The way IP address reservation works in that article is more aligned with how I expected it to work in GKE. Is there a similar way to set that style of networking in GKE? Where only the nodes have IP addresses on the actual VPC Network, and the pod IP addresses are only addressable from inside the cluster.


To summarize the end state I'm trying to achieve: I want two clusters to exist on the same VPC network, with each cluster reusing the same ip ranges for their pods. For example...

VPC Network:
Ip range:
Subnet 1:
Subnet 2:

Cluster 1 (Subnet 1):
Node CIDR:

Cluster 2 (Subnet 2):
Node CIDR:

Have a look at the GKE network overview and IP allocation:

  • Each node has an IP address assigned from the cluster's Virtual Private Cloud (VPC) network.
  • Each node has a pool of IP addresses that GKE assigns Pods running on that node (a /24 CIDR block by default).
  • Each Pod has a single IP address assigned from the Pod CIDR range of its node.
  • Each Service has an IP address, called the ClusterIP, assigned from the cluster's VPC network.

Here you can find more information how to set network policies in your cluster.

Edit Unfortunately you're not able to use such IP allocation as you described.

  • 1
    According to what I've seen on that documentation, the ip range for the cluster's pods have to be a subnet on your VPC network. So two clusters on the same VPC network can't have their pods use IPs from the same CIDR block, which is what I'm trying to accomplish. I've edited my question to hopefully provide more clarity. – Workman Dec 23 '19 at 13:16
  • I've updated my answer. – Serhii Rohoza Dec 23 '19 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.