Other Articles

GKE – Enable Private Nodes

Secure Configuration Checks > GCP

This check ensures that the nodes of a Google Kubernetes Engine (GKE) cluster use private IP addresses. With private nodes, the worker machines have no public IP address and cannot be reached directly from the internet.

Check Details

  • Resource: GKE Cluster
  • Check: Enable private nodes
  • Risk: If nodes have public IP addresses, attackers can scan and attack them directly from the internet, which increases the chance of a compromise of the cluster and its workloads.

Remediation via Google Cloud Console

  1. Log in to the Google Cloud Console and navigate to Kubernetes Engine > Clusters. GKE Clusters
  2. Click the name of the affected GKE cluster.
  3. In the cluster details page, locate the Private Nodes section.
  4. Under Default New Node-Pool Configuration, click Edit Private Nodes. GKE Private Nodes Configuration
  5. Select Enable private nodes.
  6. Click Save changes to apply the configuration. Enable Private Nodes

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. List the GKE clusters that do not use private nodes:

    gcloud container clusters list \
    --filter="NOT privateClusterConfig.enablePrivateNodes=true" \
    --format="table(name,location)"
    
  3. Enable private nodes on the cluster:

    gcloud container clusters update <CLUSTER_NAME> \
    --location <LOCATION> \
    --enable-private-nodes
    
  4. Enable private nodes on each existing node pool:

    gcloud container node-pools update <NODE_POOL_NAME> \
    --cluster <CLUSTER_NAME> \
    --location <LOCATION> \
    --enable-private-nodes
    
  5. Verify the setting:

    gcloud container clusters describe <CLUSTER_NAME> \
    --location <LOCATION> \
    --format="value(privateClusterConfig.enablePrivateNodes)"
    

    Replace <CLUSTER_NAME> with the name of your GKE cluster, <LOCATION> with its region or zone, and <NODE_POOL_NAME> with the name of the node pool. The value in the last command must be True. Nodes without public IP addresses cannot reach the internet on their own, so set up Cloud NAT if your workloads need outbound internet access.

Default Value

By default, GKE nodes are created with public IP addresses. Private nodes are used only when they are explicitly enabled.

Updated on 09 November, 2026