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:
$ 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:
-
cluster-name
: The name of the cluster, with a maximum length of 40 alphanumeric characters and dashes (-). This name must not start or end with a dash, and it must be unique within the project. -
(optional)
project-name
: The name of the project in which you want to delete the node pool. -
nodepool-name
: The name of the node pool you want to delete.
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
.
$ kubectl scale deployment cilium-operator --namespace kube-system --replicas 0
$ kubectl scale deployment cilium-operator --namespace kube-system --replicas 1
Related Pages