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 `NODEPOOL_NAME`
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 where the cluster will be created. -
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 “NODEPOOL_NAME” deleted
.
Node Pool Deletion Taking Too Long
When a Node is deleted, it is first drained. If the node pool deletion process takes too long, check all PodDisruptionBudget
resources, as they may be preventing Nodes from draining. Another possible cause could be 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