1

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.

Edit

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: 10.0.0.0/8
Subnet 1: 10.0.1.0/24
Subnet 2: 10.0.2.0/24

Cluster 1 (Subnet 1):
Node CIDR: 10.0.1.0/24
Pod CIDR: 192.168.0.0/16

Cluster 2 (Subnet 2):
Node CIDR: 10.0.2.0/24
Pod CIDR: 192.168.0.0/16
Workman
  • 11
  • 2

1 Answers1

1

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.

Serhii Rohoza
  • 1,354
  • 2
  • 4
  • 14
  • 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