Skip to main content
In this tutorial, you’ll learn how to provision a VPC-native Google Kubernetes Engine (GKE) cluster with IP aliasing and manage its secondary IP ranges. We’ll walk through:

1. Set the Compute Zone

Configure your default compute zone to us-west1-a (or your preferred region).

2. Create a Custom VPC

Create a VPC in custom subnet mode so you can define your own IP ranges.
In the Google Cloud Console, navigate to VPC network → VPC networks. You should see gke-deep-dive-vpc listed, but no subnets yet.

3. Add a Regional Subnet

Define a subnet in us-west1 with a /24 CIDR block.
VPC networks are global, whereas subnets are regional. Choose the region that best suits your workload.
Refresh VPC networks → Subnets in the Console to confirm the gke-deep-dive-subnet (10.10.0.0/24) appears under your VPC.

4. Launch an IP-Alias (VPC-native) GKE Cluster

Use IP aliasing to allocate two secondary IP ranges—one for Pods and one for Services.
Cluster provisioning can take several minutes.

5. Verify Secondary Ranges

Console View

In the Cloud Console, open VPC networks → Subnets and select gke-deep-dive-subnet. You should see two new secondary IP ranges:
The image shows a Google Cloud Platform interface displaying details of a VPC subnet named "gke-deep-dive-subnet," including its IP ranges, region, and other network settings.

CLI Verification

Describe the cluster’s IP allocation policy:
Look for these fields in the output:
  • clusterIpv4Cidr
  • servicesIpv4Cidr
  • clusterSecondaryRangeName
  • servicesSecondaryRangeName

6. Clean Up Resources

Delete the GKE Cluster

Secondary ranges are automatically detached from gke-deep-dive-subnet upon cluster deletion.

Remove Subnet and VPC

Back in the Console, verify that only the default VPC remains:
The image shows a Google Cloud Platform interface for managing VPC networks, displaying options for network analytics and a list of existing VPC networks with details like subnets and firewall rules.
Resource deletion is irreversible. Ensure no critical workloads are running before you clean up.

Watch Video