Error waiting for creating GKE cluster: All cluster resources were brought up, but nodes x out of x…

Error waiting for creating GKE cluster: All cluster resources were brought up, but nodes x out of x are unhealthy This error typically arises when setting up a Google Kubernetes Engine (GKE) cluster in a fully isolated network environment.

Source comparison and review notes
  • Automated pair-review warning (AI bilingual content review): Both route sections give restricted.googleapis.com destination 34.36.153.4/30, while the Spanish DNS-record table gives 199.36.153.4 through 199.36.153.7 for that same hostname; the sources are internally inconsistent and the route literal should be treated as unsafe source content, not normalized here.
  • Automated pair-review warning (AI bilingual content review): English omits the Spanish module-created DNS-record table and most of the explicit Private Google Access requirements, leaving only the hostnames as dangling code-like text.

Error waiting for creating GKE cluster: All cluster resources were brought up, but nodes x out of x are unhealthy

This error typically arises when setting up a Google Kubernetes Engine (GKE) cluster in a fully isolated network environment. It usually involves issues with cluster nodes interacting with Google Services or APIs due to specific route configurations.

Error Summary

VPC Route Configuration

In the “Routes” section of the Virtual Private Cloud (VPC):

  • The default route (0.0.0.0/0) does not have the “Default Internet Gateway” as its “Next Hop”. Instead, it routes through a VM or an appliance.
Plain text
0.0.0.0/0

GKE Deployment Logs

  • The GKE cluster deployment logs show that all cluster resources are created and node VMs are present in the project.
  • However, examining the VM’s serial port logs (Serial Port 1) reveals that DNS resolution works correctly, but endpoints generate “Timeout” errors.

GKE Deployment Log Analysis

Cluster resources appear in the project, confirming their creation. To view the deployment logs:

  1. Access the VM and click on Serial Port 1:
  1. Review the automated deployment logs:

In this instance, DNS resolution works, but endpoints generate timeouts.

Solution

To resolve this, configure the appropriate Routes and DNS settings.

IPv4 Routes

For private.googleapis.com:

  • Destination: 199.36.153.8/30
  • Next Hop: default-internet-gateway
Plain text
199.36.153.8/30
default-internet-gateway
  • Destination: 34.126.0.0/18
  • Next Hop: default-internet-gateway
Plain text
34.126.0.0/18
default-internet-gateway

For restricted.googleapis.com:

  • Destination: 34.36.153.4/30
  • Next Hop: default-internet-gateway
Plain text
34.36.153.4/30
default-internet-gateway
  • Destination: 34.126.0.0/18
  • Next Hop: default-internet-gateway
Plain text
34.126.0.0/18
default-internet-gateway

DNS Configuration

Use the following Terraform module for DNS configuration:

Terraform Module: PGA Private DNS Records

Terraform Registry
Edit descriptionregistry.terraform.io

This module creates the necessary records:

Why Does This Happen?

See below:

Network Isolation

  • The GKE cluster is in a VPC that is completely isolated from the internet, preventing nodes from communicating with Google services.

Route Configuration

  • The default route (0.0.0.0/0) in the VPC does not use the “Default Internet Gateway” as “Next Hop”, but is redirected to a VM or appliance, hindering traffic to Google services.

Private Google Access

  • DNS resolution works, but endpoints are unreachable due to the lack of proper “Private Google Access” configuration.

Private Google Access

This allows VMs on Google Cloud without external IP addresses to access Google APIs and services through internal IP addresses.

How It Works

  • Without Private Google Access: A VM without an external IP can only communicate with internal resources within the same VPC network.
  • With Private Google Access: The same VM can communicate with Google APIs and services, even without an external IP, by configuring the VPC network appropriately.

Considerations

Default Routes

  • Ensure a default route with default-internet-gateway as Next Hop and a destination range of 0.0.0.0/0 for IPv4 and ::/0 for IPv6.

Requirements

Plain text
private.googleapis.com
restricted.googleapis.com

When to Use private.googleapis.com vs. restricted.googleapis.com

  • private.googleapis.com: Use this when you need access to most Google APIs and services, including Google Maps, Google Ads, Google Cloud, etc. This does not support Google Workspace web apps.
Plain text
private.googleapis.com
  • restricted.googleapis.com: Use this when you only need access to Google APIs and services that support VPC Service Controls. This restricts access to APIs and services supporting VPC Service Controls and does not allow access to Google Workspace web apps.
Plain text
restricted.googleapis.com

Conclusion

Choose private.googleapis.com or restricted.googleapis.com based on your specific needs for accessing Google's APIs and services.

Mateo Di Loreto

Thanks for reading. The learning continues in the next article.