Default strategy of GKE node route IP assignment

4/29/2016

As I understand it, in a GKE cluster each member VM/node is assigned an IP in the default project subnet and also assigned a route with an internal range that is outside the default supplied network. Pods within a VM are assigned an IP from this routed range.

What is the logic or strategy behind the route ip range assigned to each gke node? Does it change between multiple clusters in the same project? Does it change across projects?

In general, is there particular documentation by either k8s or gke that specifies clearly how gke does it's network magic?

-- caseyh
google-compute-engine
google-kubernetes-engine
kubernetes

1 Answer

4/29/2016

When you create a cluster, you can specify a /14 CIDR (the clusterIpv4Cidr field), from which all the route IP ranges will be selected. If you don't specify a CIDR, then GKE will automatically select one for you that isn't currently being used in your cluster's network.

The cluster CIDR that gets chosen will be passed to the Kubernetes apiserver, which will assign a /24 out of that range to each node that registers with it.

You might find these docs interesting if you haven't already seen them: http://kubernetes.io/docs/admin/networking/#google-compute-engine-gce https://github.com/kubernetes/kubernetes/blob/release-1.2/docs/design/networking.md

-- Alex Robinson
Source: StackOverflow