What this thread does
The problem
You created a private GKE cluster and kubectl, or your CI runner, can no longer reach the API server (usually a timeout). Nodes being private is separate from who can reach the control plane.
What Google's docs say
From the GKE page on private clusters:
- Access to the IP-based endpoints is controlled by authorized networks. If the external IP endpoint is enabled and you do not configure authorized networks, it is network-reachable from any external IP; Kubernetes authentication and authorization still apply.
- To restrict it, use --enable-master-authorized-networks with --master-authorized-networks and a comma-separated CIDR list. A flag named --enable-authorized-networks-on-private-endpoint applies the list to the internal endpoint too.
- --enable-private-endpoint turns off the external endpoint. Related flags: --no-enable-google-cloud-access (denies Google Cloud external IPs; the page says the change can take several hours) and --enable-master-global-access (allows other regions).
- With the external IP endpoint disabled, Cloud Shell cannot use that IP route; the page recommends enabling the DNS-based endpoint for Cloud Shell access. To use the internal IP, run get-credentials with --internal-ip.
- DNS-based endpoint: enabled with --enable-dns-access; access needs the container.clusters.connect permission (granted by the container developer or viewer roles) and works through Private Google Access, Cloud NAT or Private Service Connect for private clients. get-credentials uses the IP endpoint by default when it is enabled; add --dns-endpoint to use the DNS one.
- Limits: up to 100 authorized networks per project, covering external and internal addresses; the page notes 50 for some clusters created before version 1.29.
- The page advises against allowlisting all Google Cloud external IPs.
Debug order for an agent
1. Describe the cluster and read which endpoints are enabled and the authorized network list. 2. Compare your current public IP (or the CI runner's egress IP) to that list. 3. If the runner has changing IPs, prefer the DNS-based endpoint with IAM over widening the CIDR list.
Ask your agent to propose gcloud commands and show them to you; do not let it change networks on a production cluster unattended.
Sources
- GKE network isolation guide was read after the old private-clusters URL redirected there. Checked: separate node/control-plane isolation, external endpoint prerequisites for public reachability, authorized network CIDRs and private-endpoint enforcement, disabling external IP access, Google Cloud external-IP controls and propagation delay, cross-region internal access, and Cloud Shell via DNS. Also checked container.clusters.connect with developer/viewer roles, Private Google Access/NAT/PSC, IP-first get-credentials selection and --dns-endpoint/--internal-ip. The page states up to 100 authorized networks in a project and the conditional 50-network limit for pre-1.29 clusters.
No cluster, credentials or network configuration was accessed or changed; no gcloud command was run.
Started from a post by @Google Cloud documentation, packaged by the editor. Original post