Node Pools

This page provides an overview of node pools, and how to use them with Google Kubernetes Engine.

Overview

A node pool is a subset of node instances within a cluster that all have the same configuration.

When you create a container cluster, the number and type of nodes that you specify becomes the default node pool. Then, you can add additional custom node pools of different sizes and types to your cluster. All nodes in any given node pool are identical to one another.

For example, you might create a node pool in your cluster with local SSDs, a minimum CPU platform, preemtible VMs, a specific node image, larger instance sizes, or different machine types. Custom node pools are useful when you need to schedule Pods that require more resources than others, such as more memory or more local disk space.

You can create, upgrade, and delete node pools individually without affecting the whole cluster using the gcloud container node-pool command.

By default, all new node pools run the latest stable version of Kubernetes. Existing node pools can be upgraded manually or automatically. You can also run multiple Kubernetes node versions on each node pool in your cluster, update each node pool independently, and target different node pools for specific deployments.

Nodes in multi-zone clusters

If your cluster was created with the --additional-zones flag, or with the Additional zones options enabled in Cloud Platform Console, all of the node pools are replicated to those zones automatically. Any new node pool that is created is automatically created in those zones. Similarly, any deletions delete those node pools from the additional zones as well.

Note that because of this multiplicative effect, this may consume more of your project's quota for a specific region when creating node pools.

For more information, refer to Multi-Zone Clusters.

Creating a custom node pool

Node pools are created using a NodeConfig specification. Each node in the pool has a Kubernetes node label with the node pool's name in the key cloud.google.com/gke-nodepool.

Console

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

  1. Visit the Kubernetes Engine menu in the Google Cloud Platform Console.

    Visit the Kubernetes Engine menu

  2. Select the desired cluster.

  3. Click Edit.
  4. From the Node pools menu, click Add node pool.
  5. Configure your node pool as desired. To enable advanced options, such as automatic upgrades and autoscaling, click More.
  6. Click Save.

gcloud

To create a node pool, run the following command:

gcloud container node-pools create [POOL-NAME] --zone [ZONE] --cluster [CLUSTER-NAME]

Optional flags:

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

Viewing node pools in a cluster

Console

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

  1. Visit the Kubernetes Engine menu in the Google Cloud Platform Console.

    Visit the Kubernetes Engine menu

  2. Select the desired cluster.

  3. From the Node pools menu, click the disclosure icon beside the desired node pool. The menu expands to display details about the node pool.

gcloud

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

gcloud container node-pools list --zone [ZONE] --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] --zone [ZONE] --cluster [CLUSTER-NAME]

Upgrading a node pool

Console

To upgrade a node pool, perform the following steps:

  1. Visit the Kubernetes Engine menu in the Google Cloud Platform Console.

    Visit the Kubernetes Engine menu

  2. Select the desired cluster.

  3. From the Node pools menu, click the Upgrade link beside the desired node pool.
  4. Select the desired Kubernetes version.
  5. Click Change.

gcloud

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

gcloud container clusters upgrade [CLUSTER-NAME] --zone [ZONE]

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

gcloud container clusters upgrade [CLUSTER-NAME] --node-pool [POOL-NAME] --zone [ZONE]

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.

Console

To delete a node pool, perform the following steps:

  1. Visit the Kubernetes Engine menu in the Google Cloud Platform Console.

    Visit the Kubernetes Engine menu

  2. Select the desired cluster.

  3. Click Edit.
  4. From the Node pools menu, click the edit icon beside the desired node pool.
  5. To delete the node pool, click the delete icon.
  6. Click Save.

gcloud

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

gcloud container node-pools delete [NAME] --zone [ZONE] --cluster [CLUSTER-NAME]

What's next

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Kubernetes Engine