This page provides an overview of Node Pools, and how to use them with Google Container Engine.
A node pool is a subset of machines within a cluster that all have the same configuration.
While all nodes in a container cluster are identical, node pools let you create pools of machines within your cluster that have different configurations. For example, you might create a pool of nodes in your cluster that have local SSDs or larger instance sizes.
Node pools are useful for customizing the instance profile in your cluster. 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.
Creating a node pool
The create call takes a NodeConfig
JSON file and creates a pool of machines with it. Each node in the pool has a
Kubernetes node label with the node pool's name in the
To add a node pool to a project in the Cloud Platform Console, go to the Container clusters page and edit a cluster. On the edit screen, you should see an + Add node pool button.
You create a node pool by using the
gcloud container node-pools command:
gcloud container node-pools create NAME --zone ZONE --cluster CLUSTER
--machine-type: The Google Compute Engine machine type (e.g.
n1-standard-1) to use for instances in this container cluster. If unspecified, the default machine type is
--num-nodes: Specifies the number of nodes to create in the container cluster. Default is 3. Your Cloud Platform Console project must have enough quota for the number of nodes, as well as sufficient route quota.
--disk-size: Size in GB for node VM boot disks. Defaults to 100GB.
--enable-cloud-endpoints: Automatically enable Google Cloud Endpoints to take advantage of API management features. Enabled by default, use
--image-type: The image type to use for the node pool. Image type specifies the base OS that the nodes in the node pool run on. If an image type is specified, that is assigned to the node pool and all future upgrades use the specified image type. If it is not specified, the server chooses the default image type.
--min-cpu-platform: The baseline minimum CPU platform to run on the nodes.
The default image type and the list of valid image types are available using the following command.
gcloud container get-server-config
--scopes SCOPE,[SCOPE,...]: Specifies scopes for the node instances. The project's default service account is used. Examples:
gcloud container node-pools create example-cluster \ --scopes https://www.googleapis.com/auth/devstorage.read_only gcloud container node-pools create example-cluster \ --scopes bigquery,storage-rw,compute-ro
Multiple SCOPEs can specified, separated by commas. The scopes necessary for the cluster to function properly (
storage-ro), are always added, even if not explicitly specified.
SCOPE can be either the full URI of the scope or an alias. Available aliases are:
For the full list of options, see gcloud container node-pools create.
node-pools create request returns the node pool information:
Creating node pool example-pool...done. Created [https://container.googleapis.com/v1/projects/container-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 the node pools of a cluster
To view the node pools of a cluster in Cloud Developers Console, go to the Container clusters page, and click the name of any existing clusters in your project. The node pool details are listed under the Node Pools heading.
To view a particular node pool in a cluster, use the
gcloud node-pools describe command:
gcloud container node-pools describe [NAME] --zone [ZONE] --cluster [CLUSTER]
To list all the node pools of a cluster, use the
gcloud node-pools list command:
gcloud container node-pools list --zone [ZONE] --cluster [CLUSTER]
Deleting a node pool
Deleting a node pool deletes the nodes and routes to them. Any Pod 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.
To delete a container cluster, use the
gcloud node-pools delete command:
gcloud container node-pools delete [NAME] --zone [ZONE] --cluster [CLUSTER]
If your cluster was created with the
--additional-zones option, 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.