Deleting an OKE Node Pool Node
These procedures describe how to explicitly delete a worker node. Worker nodes are also deleted when you update a node pool to scale down the node pool. See Updating an OKE Node Pool.
Deleting a worker node permanently deletes the node. You cannot recover a deleted worker node.
When you delete a node, by default a new node is created to satisfy the node count set for the pool. To override this behavior, select the option to decrease node pool size.
Do not use the kubectl delete node
command to terminate worker nodes in an
OKE cluster. The kubectl delete
node
command removes the worker node from the cluster's etcd key-value store, but
the command does not terminate the underlying compute instance.
Using the Compute Web UI
-
On the dashboard, select Containers / View Kubernetes Clusters (OKE).
-
Select the name of the cluster that contains the node that you want to delete.
-
On the cluster details page, scroll to the Resources section, and select Node Pools.
-
Select the name of the node pool that contains the node that you want to delete.
-
On the node pool details page, scroll to the Resources section, and select Nodes.
-
For the node that you want to delete, select the Actions menu, and select Delete.
-
Confirm the deletion.
-
If you do not want a new node to be automatically created to replace the deleted node, select Decrease node pool size.
-
Check the box if you want to override the eviction grace duration in the cordon and drain settings for the node.
Use the arrows to decrease or increase the number of minutes of eviction grace duration. See the description of this field in Updating an OKE Node Pool.
You cannot deselect "Force terminate after grace period." The node is deleted after its pods are evicted or at the end of the eviction grace duration, even if not all pods are evicted.
For descriptions of cordon and drain and eviction grace duration, see "Node and node pool deletion settings" in "Using the OCI CLI" in Creating an OKE Worker Node Pool.
-
Select the Delete button on the dialog.
-
Using the OCI CLI
-
Get the information you need to run the command.
-
OCID of the node pool:
oci ce node-pool list
-
OCID of the node:
oci ce node-pool list
-
-
Run the delete node pool node command.
If you do not want a new node to be automatically created to replace the deleted node, specify the
--is-decrement-size
option.Example:
$ oci ce node-pool delete-node --node-pool-id ocid1.nodepool.unique_ID \ --node-id ocid1.instance.unique_ID --is-decrement-size true --force
You can use the
--override-eviction-grace-duration
option to set a new value forevictionGraceDuration
for this node deletion. See the description of--node-eviction-node-pool-settings
in Creating an OKE Worker Node Pool. Fornode-pool delete-node
, this new eviction grace duration value only applies to the node being deleted.