Deleting a Node Pool

You can delete node pools that you no longer need.

You cannot delete the last node pool of a cluster.

If you want to temporarily delete a large number of nodes from your cluster, you can create a minimal 1-node node pool, or you can delete the cluster completely.

Deleting a Node Pool Using OKS CLI

To delete one of your node pools, use the cluster nodepool delete command following this syntax:

Request sample
$ oks-cli cluster nodepool \
    --project-name NAME_OF_PROJECT \
    --cluster-name NAME_OF_CLUSTER \
    delete \
    --nodepool-name NAME_OF_NODEPOOL

This command contains the following options that you need to specify:

  • nodepool-name: The name of the node pool that you want to delete.

  • (optional) cluster-name: The name of the cluster to which the node pool is attached.

  • (optional) project-name: The name of the project containing the cluster and its node pool.

Your node pool is deleted when the following message is returned: nodepool.oks.dev NAME_OF_NODEPOOL deleted.

Node Pool Deletion Taking Too Long

When a node is being deleted, it is first drained. If deletion takes too long, check for any PodDisruptionBudget resources that might be blocking the drainage. You can also check for the status of the cilium-operator Pod in the kube-system namespace.

To allow the node pool deletion, scale down the cilium-operator deployment for 1 minute, then scale it back up to 1.

Request sample
$ kubectl scale deployment cilium-operator --namespace kube-system --replicas 0

$ kubectl scale deployment cilium-operator --namespace kube-system --replicas 1

Related Pages