Skip to main content

Managing your Node Pools

Select your cluster's CMK version. To check a cluster's version, see What's new in CMK v2.

What to know about node pools​

  • A node pool is a group of VMs of the same instance type that join your cluster as worker nodes.
  • count is the number of nodes you want. The pool keeps that many running. If a VM is deleted, the pool replaces it. If a VM is stopped, the pool adds a new VM in its place and leaves the stopped VM alone.
  • current is the number of nodes that joined the cluster and became Ready. If nodes couldn't be created, the pool's health issues say why.
  • Changes to a node pool apply to its running nodes, except changes to the Kubernetes version, ephemeral storage for containerd, and SSH key. Those apply only to nodes created after the change.
  • Lowering count removes nodes only if you turn on allow scale down. See Scale down a node pool.
  • The remediation policy controls how Crusoe repairs unhealthy nodes. See AutoClusters in CMK v2.
  • A node pool can have up to 500 nodes.

You need Crusoe CLI 1.0.10 or later, or Terraform provider 1.5.0 or later.

Create a node pool​

Use the crusoe kubernetes nodepools create command:

crusoe kubernetes nodepools create \
--name my-node-pool \
--cluster-name my-cluster \
--type h100-80gb-sxm-ib.8x \
--count 4 \
--ib-partition-id <ib-partition-id>

Optional flags:

  • --node-labels: Labels for every node, such as team=ml,env=prod.
  • --node-taints: Taints for every node, such as dedicated=gpu:NoSchedule. If your CLI doesn't show this flag, contact support to turn on taints for your organization.
  • --keyfile: Path to the SSH public key for the nodes. Defaults to the key in your CLI configuration.
  • --node-pool-version: The worker node version. Defaults to the newest version that's compatible with the cluster.
  • --ephemeral-storage-for-containerd=true: Use the local NVMe disk for containerd storage.
  • --consent-mode: The remediation policy, auto, propose, or off. Defaults to auto.
  • --allow-scale-down=true: Let a lower count remove nodes. Defaults to false.

To see every flag, run crusoe kubernetes nodepools create --help.

If capacity is short, creation finishes with fewer nodes than count. The pool keeps adding nodes until it reaches count.

View node pools​

List the node pools in a cluster:

crusoe kubernetes nodepools list --cluster-name my-cluster

Get one node pool:

crusoe kubernetes nodepools get my-node-pool

The output shows desired count, running count (the API's current), state, and any health issues.

Node pool states​

StateMeaning
STATE_PROVISIONINGThe pool is being created.
STATE_RUNNINGThe pool is running.
STATE_RUNNING_WITH_ERRORThe pool is running but is short of count because nodes couldn't be created. CMK keeps retrying.
STATE_UPDATINGAn update is in progress.
STATE_DELETINGThe pool is being deleted, or a delete failed. Delete it again to retry.

You can update a pool in STATE_RUNNING or STATE_RUNNING_WITH_ERROR. You can delete a pool in those states or in STATE_DELETING.

Health issues​

CodeMeaningWhat to do
INSUFFICIENT_CAPACITYNo capacity for the instance type.Wait while CMK retries, or lower count.
INSUFFICIENT_QUOTAThe project's quota doesn't cover the nodes.Raise the quota or lower count.
INTERNAL_ERRORCMK couldn't add nodes. This includes nodes that didn't become Ready within 20 minutes and were deleted.Wait while CMK retries. If it persists, contact support.
NODE_NOT_READYOne or more nodes report NotReady. This doesn't change the pool's state.Inspect the node with kubectl describe node.

Update a node pool​

You can change the node count, node labels, node taints, Kubernetes version, ephemeral storage for containerd, remediation policy, and allow scale down.

Changes apply to running nodes right away, except the Kubernetes version and ephemeral storage, which apply only to nodes created after the change. To apply them to existing nodes, see Replace nodes.

When you set node labels or taints, the pool replaces the full set of labels or taints it applied before, on every node. Labels and taints that the pool didn't apply, such as those from the kubelet, add-ons, or kubectl, stay in place. A NoExecute taint immediately evicts pods that don't tolerate it from every node in the pool.

crusoe kubernetes nodepools update my-node-pool \
--count 6 \
--node-labels "team=ml,env=prod" \
--consent-mode auto

Pass only the flags for the settings you want to change. To see every flag, run crusoe kubernetes nodepools update --help.

Scale down a node pool​

By default, lowering count removes no nodes. The update succeeds and returns a warning that scale-down is disabled.

To let a lower count remove nodes, turn on allow scale down. You can do it in the same update:

crusoe kubernetes nodepools update my-node-pool \
--allow-scale-down=true \
--count 2

In Terraform, set update_settings = { allow_scale_down = true }.

The pool removes nodes in this order:

  1. Nodes that have been NotReady for 20 minutes or more
  2. VMs that never joined the cluster
  3. The oldest nodes

For each node, the pool evicts pods and respects PodDisruptionBudgets for up to 5 minutes. It then deletes any remaining pods and the VM.

If the pool already has more nodes than count, turning on allow scale down removes the extra nodes right away.

Don't turn on allow scale down for a pool that the Cluster Autoscaler manages. The autoscaler removes nodes on its own.

Replace nodes​

Node pools have no rolling update. To move a node to a new Kubernetes version or ephemeral storage setting, replace it:

  1. Drain the node:

    kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
  2. Delete the node's VM, which has the same name as the node:

    crusoe compute vms delete <node-name>

The pool creates a replacement with the current settings. To limit lost capacity, replace one node at a time. Don't stop the VM instead of deleting it. A stopped VM stays in the pool, and the pool adds another VM next to it.

Delete a node pool​

Deleting a node pool deletes its VMs without draining them. Move your workloads off the pool first. You must delete every node pool in a cluster before you delete the cluster.

crusoe kubernetes nodepools delete my-node-pool

If you have problems creating or deleting node pools, contact support.