- Provision a private Google Kubernetes Engine (GKE) cluster with no external node IPs
- Explore how private endpoints restrict API access
- Attempt to authorize an external IP and observe the limitation
- Create a public-endpoint cluster with Master Authorized Networks for controlled external access
- A Google Cloud project (set via
gcloud config set project [PROJECT_ID]) - Cloud Shell
- gcloud CLI installed
Verify your active project:

1. Set Your Compute Zone
Configure your default zone tous-west1-a:
2. Create a Private-Endpoint Cluster
We’ll build a VPC-native cluster calledgke-deep-dive with:
| Feature | Description |
|---|---|
| Private nodes | Nodes with no external IP |
| Private endpoint | Control plane accessible only via private IP |
| IP aliasing | Pod and service CIDRs managed by GKE |
| 10 GB PD-standard disk | Persistent disk for node OS and kubelet data |
Cluster provisioning may take 10–15 minutes.
You can monitor progress in the Cloud Console or via
You can monitor progress in the Cloud Console or via
gcloud container operations list.3. Verify the Private Cluster Configuration
Inspect the cluster to confirm private nodes and endpoint settings:GKE still creates a public endpoint for Google-managed operations, but by default it is not accessible from outside the VPC.
4. Try Authorizing an External IP
Fetch your Cloud Shell VM’s public IP and attempt to whitelist it:Private-endpoint clusters only accept reserved VPC networks for API access.
External public IPs cannot be added to master authorized networks in this configuration.
External public IPs cannot be added to master authorized networks in this configuration.
5. Create a Public-Endpoint Cluster with Master Authorized Networks
To allow restricted external API access, we’ll spin upgke-deep-dive-public:
This cluster also takes 10–15 minutes to provision.
5.1 Authorize Your External IP
Retrieve your IP again and whitelist it for the new cluster:5.2 Confirm Master Authorized Networks
Run:6. Access Your Public-Endpoint Cluster
Configurekubectl and list nodes:
READY state.
7. Compare Your Clusters
List all clusters in the zone:| Cluster Name | Private Endpoint | Public Endpoint | Master Auth Networks |
|---|---|---|---|
| gke-deep-dive | Enabled | Disabled | N/A |
| gke-deep-dive-public | Disabled | Enabled | Your IP/32 |