Review GKE node and control-plane access paths

Restrict node external IPs and control-plane access paths separately to the required scope.

Description

Neither configuration gives nodes external IPs. enable_private_endpoint controls whether administrators can connect through the control plane’s external IP. The DNS endpoint has separate settings.

Potential impact

A public IP endpoint accepts external connection attempts and still enforces authentication and authorization. Disabling it without a private route can disconnect management tools.

Remediation

Set enable_private_nodes = true where nodes need no external IPs and provide their required egress. For private-only IP management, test the internal path with kubectl, CI/CD and management tools before applying enable_private_endpoint = true. Check DNS access and IAM and Kubernetes permissions separately.

Examples

To use private_cluster_config, supply the VPC, subnet, IP allocation and any control-plane address range your version requires.

Before

hcl
resource "google_container_cluster" "cluster" {
  name               = "marcellus-wallace"
  location           = "us-central1-a"
  initial_node_count = 3

  private_cluster_config {
    enable_private_endpoint = false
    enable_private_nodes    = true
  }

  timeouts {
    create = "30m"
    update = "40m"
  }
}

After

hcl
resource "google_container_cluster" "cluster" {
  name               = "marcellus-wallace"
  location           = "us-central1-a"
  initial_node_count = 3

  private_cluster_config {
    enable_private_endpoint = true
    enable_private_nodes    = true
  }

  timeouts {
    create = "30m"
    update = "40m"
  }
}

Explanation:

  • Before: With false, clients can reach the external control-plane IP even though the nodes are private.
  • After: Changing the same cluster to true restricts IP-based control-plane access to internal paths.

References