Skip to main content
Skip table of contents

Create vSphere Node Pools

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

Prepare the environment

Follow these steps:

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

    CODE
    export CLUSTER_NAME=my-vsphere-cluster

  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:

    CODE
    export KUBECONFIG=${CLUSTER_NAME}.conf

  3. Define your node pool name:

    CODE
    export NODEPOOL_NAME=example

Create a vSphere node pool

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

CODE
dkp create nodepool vsphere ${NODEPOOL_NAME} \
  --cluster-name=${CLUSTER_NAME} \
  --network=example_network \
  --data-center=example_datacenter \
  --data-store=example_datastore \
  --folder=example_folder \
  --server=example_vsphere_api_server_url\
  --resource-pool=example_resource_pool \
  --vm-template=example_vm_template \
  --replicas=3

The output resembles this example:

CODE
machinedeployment.cluster.x-k8s.io/example created
vspheremachinetemplate.infrastructure.cluster.x-k8s.io/example created
kubeadmconfigtemplate.bootstrap.cluster.x-k8s.io/example created
 ✓ Creating default/example nodepool resources

This example uses default values for brevity. Advanced users can use a combination of the --dry-run and --output=yaml 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.