Delete a cluster
Deleting a cluster removes the control plane, all worker nodes, the cluster network and all data in the cluster – including the persistent volumes.
Deletion is permanent and cannot be undone. Back up or migrate your data completely before you continue.
Prerequisites
- Access to ccloud
- A working connection via
kubectl, as long as you still want to back up data
Before deleting
Work through these points while the cluster is still running:
-
Back up application data – data in persistent volumes is deleted with the cluster. Back it up, for example in S3 Object Storage.
-
Back up the configuration – export your manifests unless they are already in version control:
kubectl get all -A -o yaml > cluster-backup.yaml -
Back up secrets – credentials and certificates that exist only in the cluster are lost.
-
Delete services of type
LoadBalancer– so that the public IP addresses are released cleanly:kubectl get svc -A --field-selector spec.type=LoadBalancer
kubectl delete svc <name> -n <namespace> -
Check external references – DNS records that point to IP addresses of this cluster stop working after deletion.
Delete the cluster
- Open the cluster in ccloud.
- Select Delete and confirm.
The cluster changes to the status Deleting and disappears from the overview once it has been removed.
What is deleted
| Resource | Behaviour |
|---|---|
| Control plane and worker nodes of all node pools | Removed |
| Workloads in the cluster | Terminated |
| Persistent volumes | Deleted |
| Cluster network | Removed |
| Kubeconfig files | No longer valid |
Resources outside the cluster – such as data in S3 Object Storage – are not affected by the deletion.
Remove individual resources instead of the whole cluster
A smaller change is often enough:
| Goal | Approach |
|---|---|
| Remove a node pool you no longer need | See Add node pools |
| Remove an application | kubectl delete or helm uninstall |