Add or remove node pools in a cluster

In GKE on Bare Metal, you add or remove node pools in a cluster by creating or deleting node pool custom resources. You use kubectl to make node pool changes.

You can only add or delete worker node pools for an existing cluster. The control plane and load balancer node pools added during cluster creation are critical to the cluster's function and cannot be deleted.

Check node status

Before adding or removing node pools, use kubectl get to check the status of nodes and their respective node pools. For more information, including a sample command and response, see Viewing node status.

Add a new node pool

You can add new node pools by creating a new resource in the admin cluster. For example, you specify the following configuration to add a new node pool named "nodepool- new" with node IP addresses and

  kind: NodePool
    name: node-pool-new
    namespace: cluster-my-cluster
    clusterName: my-cluster
    - address:
    - address:
    - key: <key1>
      value: <value1>
      effect: NoSchedule
      key1: <value1>
      key2: <value2>

NodePool.spec.taints and NodePool.spec.labels configurations are reconciled to nodes. All taints and labels that are directly added are removed. The control plane doesn't remove the taints and labels that you add directly during the sync process.

To bypass this reconciliation step, you can annotate the node with

The node pool resource must be created in the same namespace as the associated cluster and reference the cluster name in the spec.clusterName field.

Store the configuration in a file named node-pool-new.yaml. Apply the configuration to the admin cluster with the following command. Use the --kubeconfig flag to explicitly specify the admin cluster config, if needed:

  kubectl apply -f node-pool-new.yaml

Remove a node pool

You remove node pools with kubectl delete. For example, to remove the node pool added in the preceding section, node-pool-new, use the following command:

  kubectl -n cluster-my-cluster delete nodepool node-pool-new

Removing a worker node pool in a cluster can cause Pod Disruptions. If there is a PodDisruptionBudget (PDB) in place, you may be blocked from removing a node pool. For more information about pod disruption policies, refer to Removing nodes blocked by the Pod Disruption Budget.