This topic explains how to create, update and delete node pools in a Tanzu Kubernetes (workload) cluster. Node pools enable a single workload cluster to contain and manage different types of nodes, to support the diverse needs of different applications.

For example, a cluster can use nodes with high storage capacity to run a datastore, and thinner nodes to process application requests.

About Node Pools

Node pools define properties for the sets of worker nodes used by a workload cluster.

Some node pool properties depend on the VM options that are available in the underlying infrastructure, but all node pools on all cloud infrastructures share the following properties:

  • name: a unique identifier for the node pool, used for operations like updates and deletion.
  • replicas: the number of nodes in the pool, all of which share the same properties.
  • labels: key/value pairs set as metadata on the nodes, to match workloads to nodes in the pool. For more information, and example labels, see Labels and Selectors in the Kubernetes documentation.

All workload clusters are created with a first, original node pool. When you create additional node pools for a cluster, as described below, the first node pool provides default values for properties not set in the new node pool definitions.

List Node Pools

To inspect the node pools currently available in a cluster, run:

tanzu cluster node-pool list CLUSTER-NAME

This return a lists of all of the node pools in the cluster, and the state of the replicas in each node pool.

Create a Node Pool

To create a node pool in a cluster:

  1. Create a configuration file for the node pool. See below for example configuration files for each infrastructure provider.

  2. Create the node pool defined by the configuration file:

    tanzu cluster node-pool set CLUSTER-NAME -f /PATH/TO/CONFIG-FILE
    

    Optionally, use --namespace to specify the namespace of the cluster. The default value is default.

AWS Configuration

In addition to the required name, replicas, and labels properties above, configuration files for node pools on AWS support the following optional properties:

  • az: Availability Zone
  • nodeMachineType: Instance type

    These settings may be omitted, in which case their values inherit from the cluster's first node pool.

Example node pool definition for an AWS cluster:

name: tkg-aws-wc-np-1
replicas: 2
az: us-west-2b
nodeMachineType: t3.large
labels:
  key1: value1
  key2: value2

Azure Configuration

In addition to the required name, replicas, and labels properties above, configuration files for node pools on Microsoft Azure support the following optional properties:

  • az: Availability Zone
  • nodeMachineType: Instance type

    These settings may be omitted, in which case their values inherit from the cluster's first node pool.

Example node pool definition for Azure cluster:

name: tkg-azure-wc-np-1
replicas: 2
az: 2
nodeMachineType: Standard_D2s_v3
labels:
  key1: value1
  key2: value2

vSphere Configuration

In addition to the required name, replicas, and labels properties above, configuration files for node pools on vSphere can include a vsphere block, to define optional properties specific to configuring VMs on vSphere.

Example node pool definition for vSphere cluster:

name: tkg-wc-oidc-md-1
replicas: 4,
labels:
  key1: value1
  key2: value2
vsphere:
  memoryMiB: 8192
  diskGiB: 64
  numCPUs: 4
  datacenter: dc0
  datastore: iscsi-ds-0
  storagePolicyName: name
  folder: vmFolder
  resourcePool: rp-1
  vcIP: 10.0.0.1
  template: templateName
  cloneMode: clone-mode
  network: network-name

Any values not set in the vsphere block inherit from the values in the cluster's first node pool.

Update Node Pools

You can update the replicas and labels settings for a node pool by using the same command that you use to create it:

tanzu cluster node-pool set CLUSTER-NAME -f /PATH/TO/CONFIG-FILE

If the CLUSTER-NAME in the command and name in the configuration file match a node pool in the cluster, this command updates the existing node pool instead of creating a new one.

This update operation allows Tanzu Kubernetes Grid to scale the node pool up or down, and add labels to the node pool. It cannot remove labels previously applied to the node pool or change the availability zone, node instance type (on AWS or Azure), or virtual machine properties (on vSphere) of the node pool.

Warning: Attempting to change the existing availability zone, node instance type, or virtual machine properties of a node pool can have severe negative impacts on running workloads. To change these properties, create a new node pool with these properties and migrate workloads to the new node pool before deleting the original.

Delete Node Pools

To delete a node pool run:

tanzu cluster node-pool delete CLUSTER-NAME

Optionally, use --namespace to specify the namespace of the cluster. The default value is default.

Warning: Migrate any workloads on these nodes to other nodes before performing this operation. tanzu cluster node-pool delete does not migrate workloads off of nodes before deleting them.

check-circle-line exclamation-circle-line close-line
Scroll to top icon