Delete a cluster
Delete a cluster and its machines, keeping it restorable for 7 days or keeping nothing.
Replace my-cluster with your cluster's name or id.
Warning
A permanent delete keeps nothing: no final snapshot, and the PersistentVolumes are deleted with their data. The cluster cannot be restored.
Prerequisites
- Permission for
eks:DeleteClusteron the cluster; to turn deletion protection off,eks:UpdateClusterConfig. - Deletion protection off. While it is on, the delete answers
409"Deletion protection is on. Turn it off in the cluster’s settings first." - In the console, also
eks:DescribeClusterto open the cluster.
Turn deletion protection off
- Open Kubernetes, open the cluster, then choose Danger zone.
- Under Deletion protection, choose Turn off. The change is saved at once.
dcloud eks clusters update my-cluster --no-deletion-protectionPATCH /eks/api/clusters/my-cluster
{ "deletionProtection": false }Set deletion_protection = false on the dcloud_eks_cluster and apply.
Delete the cluster
- On the cluster's Danger zone, under Delete this cluster, (optional) select Delete permanently: keep nothing (no snapshot, volumes deleted with their data).
- Choose Delete cluster.
- In the dialog, enter the cluster name, and choose Delete cluster.
The console returns to the cluster list.
dcloud eks clusters delete my-clusterTo keep nothing: --permanent true.
DELETE /eks/api/clusters/my-clusterTo keep nothing: ?permanent=true.
Remove the dcloud_eks_cluster and apply. Set delete_permanently = true beforehand to keep
nothing.
Result
The answer is { id, status: "deleting", permanent }. Deleting a cluster already being deleted
answers { id, status: "deleting" } and changes nothing: a permanent sent then is ignored. Deutsche Cloud then removes the machines, the node groups and
their nodes, the endpoint load balancer, the firewalls and the load balancers of the cluster's
LoadBalancer Services. Each step is in Activity.
By default, a final etcd snapshot is taken first. For 7 days the cluster is listed under Recently deleted on the Kubernetes page and can be restored: its settings, key material and PersistentVolumes are kept, the volumes detached and not billed. See Restore a deleted cluster. If the final snapshot cannot be taken and verified, nothing is kept and the cluster cannot be restored.
Permanently, nothing is kept.