Skip to main content
Skip table of contents

Create GCP Node Pools

Creating a node pool is useful when you need to run workloads that require machines with specific resources, such as additional memory, or specialized network or storage hardware.


Before you begin, make sure you have created a GCP cluster.

Prepare the environment

Follow these steps:

  1. Set the environment variable to the name you assigned this cluster.

    export CLUSTER_NAME=gcp-example
  2. If your workload cluster is self-managed, as described in Make the New Cluster Self-Managed, configure kubectl to use the kubeconfig for the cluster.

    export KUBECONFIG=${CLUSTER_NAME}.conf
  3. Define your node pool name.

    export NODEPOOL_NAME=example

Create a GCP node pool

Availability zones (AZs) are isolated locations within data center regions from which public cloud services originate and operate. Because all the nodes in a node pool are deployed in a single Availability Zone, you may wish to create additional node pools is to ensure your cluster has nodes deployed in multiple Availability Zones.

Create a new AWS node pool with 3 replicas using this command:

Set the --zone flag to a zone in the same same region as your cluster.

dkp create nodepool gcp ${NODEPOOL_NAME} \
    --cluster-name=${CLUSTER_NAME} \
    --image $IMAGE_NAME \
    --zone us-west1-b \
CODE created
⠈⠁ Creating default/example nodepool resources created created
 ✓ Creating default/example nodepool resources

This example uses default values for brevity. Use flags to define custom instance types, and other properties.

Advanced users can use a combination of the --dry-run and --output=yaml or or --output-directory=<your-target-directory>/flags to get a complete set of node pool objects to modify locally or store in version control.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.