# Delete a node group

Drain a node group's nodes and delete their machines.

Replace _my-cluster_ with your cluster's name or id, and _workers_ with the node group's name.

## Prerequisites

- Permission for `eks:DeleteNodegroup` on the node group.
- In the console, also `eks:DescribeCluster` and `eks:ListNodegroups`. The console enables
  **Delete** only with `eks:DeleteNodegroup` on every cluster (`eks:*`).

## Delete the node group

**Console**
1. Open **Kubernetes**, open the cluster, then choose **Node groups**.
2. On the node group's row, choose **Delete**.
3. In the dialog, enter the node group's name, and choose **Delete**.

**CLI**
```sh
dcloud eks nodegroups delete my-cluster workers
```

**API**
```http
DELETE /eks/api/clusters/my-cluster/nodegroups/workers
```

**Terraform**
Remove the `dcloud_eks_nodegroup` and apply.

## Result

The answer is `{ name, status: "deleting" }`. The nodes are drained (PodDisruptionBudgets respected
for up to five minutes per node), their machines deleted, then the group. Pods move to other node
groups if they fit.

## Related

- [Change a node group](change-a-node-group.md)
- `eks.nodegroups.delete` · `dcloud eks nodegroups delete` · `dcloud_eks_nodegroup`
