Adding and Managing Node Pools

This page shows you how to add and perform operations on node pools running your Google Kubernetes Engine clusters. To learn about how node pools work, refer to Node Pools.

Before you begin

To prepare for this task, perform the following steps:

  • Ensure that you have enabled the Google Kubernetes Engine API.
  • Enable Google Kubernetes Engine API
  • Ensure that you have installed the Cloud SDK.
  • Set your default project ID:
    gcloud config set project [PROJECT_ID]
  • If you are working with zonal clusters, set your default compute zone:
    gcloud config set compute/zone [COMPUTE_ZONE]
  • If you are working with regional clusters, set your default compute region:
    gcloud config set compute/region [COMPUTE_REGION]
  • Update gcloud to the latest version:
    gcloud components update

Adding a node pool

gcloud

To create a node pool, run the following command:

gcloud container node-pools create [POOL_NAME] --cluster [CLUSTER_NAME]

For the full list of options, refer to the gcloud container node-pools create documentation.

A successful node-pools create request returns the node pool information:

Creating node pool example-pool...done.
Created [https://container.googleapis.com/v1/projects/kubernetes-engine-docs/zones/us-central1-f/clusters/example-cluster/nodePools/example-pool].
NAME          MACHINE_TYPE   DISK_SIZE_GB  NODE_VERSION
example-pool  n1-standard-1  100           1.2.4

Console

To add a node pool to an existing cluster, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. In the Node pools section, click Add node pool.
  4. Configure your node pool as desired. To enable advanced options, such as automatic upgrades and autoscaling, click Advanced edit for the node pool.
  5. Click Save to close the Advanced edit overlay.
  6. Click Save again to modify the cluster.

Viewing node pools in a cluster

gcloud

To list all the node pools of a cluster, run the gcloud node-pools list command:

gcloud container node-pools list --cluster [CLUSTER_NAME]

To view details about a specific node pool, run the gcloud node-pools describe command:

gcloud container node-pools describe [POOL_NAME] \
    --cluster [CLUSTER_NAME]

Console

To view a cluster's node pools, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the name of the cluster you want to view.

  3. In the Node pools section, click the disclosure icon beside the desired node pool. The menu expands to display details about the node pool.
  4. Click Done to exit the node pool details overview.

Resizing a node pool

gcloud

To resize a node pool, you use the gcloud container clusters resize command. You must specify the cluster's name, the name of the desired node pool, and the new number of nodes:

gcloud container clusters resize [CLUSTER_NAME] --node-pool [NODE_POOL] \
    --size [SIZE]

Repeat this command for each node pool. If your cluster only has its default node pool, omit the --node-pool flag.

For more information, refer to the gcloud container clusters resize documentation.

Console

To resize your cluster's node pools, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. In the Node pools section, change the value of the Size field to the desired value. Repeat for each node pool as needed.
  4. Click Save.

Upgrading a node pool

gcloud

To update all nodes to the latest Kubernetes version, run the gcloud container clusters upgrade command:

gcloud container clusters upgrade [CLUSTER_NAME]

To update a specific node pool, specify the --node-pool flag:

gcloud container clusters upgrade [CLUSTER_NAME] --node-pool [POOL_NAME]

Console

To upgrade a node pool, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. In the Node pools section, click the Change link beside the desired node pool's Node version field.
  4. Select the desired Kubernetes version.
  5. Read the warning, then click Change to confirm.
  6. Click Save to exit the cluster modification screen.

Deleting a node pool

Deleting a node pool deletes the nodes and routes to them. Any Pods running on those nodes are evicted and rescheduled. If the Pods have specific node selectors, the Pods might remain in an unschedulable condition if no other node in the cluster satisfies the criteria.

gcloud

To delete a node pool, run the gcloud node-pools delete command:

gcloud container node-pools delete [POOL_NAME] --cluster [CLUSTER_NAME]

Console

To delete a node pool, perform the following steps:

  1. Visit the Google Kubernetes Engine menu in GCP Console.

    Visit the Google Kubernetes Engine menu

  2. Click the cluster's Edit button, which looks like a pencil.

  3. To delete the node pool, click the delete icon, which becoems visible when you hover near the Edit button, which looks like a pencil.
  4. Click Save. To return to the cluster overview page, click the arrow at the top of the screen.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Kubernetes Engine