GKE Networking#
GKE networking centers on VPC-native clusters, where pods and services get IP addresses from VPC subnet ranges. This integrates Kubernetes networking directly into Google Cloud’s VPC, enabling native routing, firewall rules, and load balancing without extra overlays.
VPC-Native Clusters and Alias IP Ranges#
VPC-native clusters use alias IP ranges on the subnet. You allocate two secondary ranges: one for pods, one for services.
# Create subnet with secondary ranges
gcloud compute networks subnets create gke-subnet \
--network my-vpc \
--region us-central1 \
--range 10.0.0.0/20 \
--secondary-range pods=10.4.0.0/14,services=10.8.0.0/20
# Create cluster using those ranges
gcloud container clusters create my-cluster \
--region us-central1 \
--network my-vpc \
--subnetwork gke-subnet \
--cluster-secondary-range-name pods \
--services-secondary-range-name services \
--enable-ip-aliasThe pod range needs to be large. A /14 gives about 262,000 pod IPs. Each node reserves a /24 from the pod range (256 IPs, 110 usable pods per node). If you have 100 nodes, that consumes 100 /24 blocks. Undersizing the pod range is a common cause of IP exhaustion – the cluster cannot add nodes even though VMs are available.