Removing Node Pools to Scale Down Clusters
Find out how to scale down clusters by removing node pools using Kubernetes Engine (OKE).
You can scale down clusters by removing node pools using the Console, the CLI, and the API.
To scale down an existing cluster by decreasing the number of node pools in the cluster:
- Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Kubernetes Clusters (OKE).
- Select the compartment that contains the cluster.
- On the Clusters page, click the name of the cluster that you want to modify.
- Under Resources, click Node Pools.
-
Scale down the cluster by removing node pools as follows:
-
Select Delete Node Pool from the Actions menu beside the node pool that you want to remove.
Note that deleting a node pool permanently deletes the node pool. You can't recover a deleted node pool.
- Enter the name of the node pool to confirm that you want to delete it.
-
Either accept the defaults for advanced node pool options, or select Show Advanced Options and specify when and how to cordon and drain worker nodes before terminating them:
- Eviction grace period (mins): The length of time to allow to cordon and drain worker nodes before terminating them. Either accept the default (60 minutes) or specify an alternative. For example, when scaling down a node pool or changing its placement configuration, you might want to allow 30 minutes to cordon worker nodes and drain them of their workloads. To terminate worker nodes immediately, without cordoning and draining them, specify 0 minutes.
- Force terminate after grace period: Whether to terminate worker nodes at the end of the eviction grace period, even if they haven't been successfully cordoned and drained. By default, this option isn't selected.
Select this option if you always want worker nodes terminated at the end of the eviction grace period, even if they haven't been successfully cordoned and drained.
De-select this option if you don't want worker nodes that haven't been successfully cordoned and drained to be terminated at the end of the eviction grace period. Node pools containing worker nodes that can't be terminated within the eviction grace period have the Needs attention status. The status of the work request that initiated the termination operation is set to Failed, and the termination operation is cancelled. For more information, see Monitoring Clusters.
For more information, see Notes on Cordoning and Draining Managed Nodes Before Termination.
- Click Delete to delete the node pool.
-
Use the oci ce node-pool delete command and required parameters to scale down a cluster by deleting a managed node pool:
oci ce node-pool delete --node-pool-id <node-pool-ocid> [OPTIONS]
Use the
oci ce virtual-node-pool delete
command and required parameters to scale down a cluster by deleting a virtual node pool:oci ce virtual-node-pool delete --virtual-node-pool-id <virtual-node-pool-ocid> [OPTIONS]
For a complete list of parameters and values for CLI commands, see the CLI Command Reference.
Run the DeleteNodePool operation to decrease the number of managed node pools in a cluster.
Run the DeleteVirtualNodePool operation to decrease the number of virtual node pools in a cluster.