Validated on 12 Mar 2021 • Last edited on 27 Sep 2023
cluster networking
DigitalOcean Kubernetes (DOKS) is a managed Kubernetes service that lets you deploy Kubernetes clusters without the complexities of handling the control plane and containerized infrastructure. Clusters are compatible with standard Kubernetes toolchains, integrate natively with DigitalOcean Load Balancers and volumes, and can be managed programmatically using the API and command line. For critical workloads, add the high-availability control plane to increase uptime with 99.95% SLA.
Destroy a Cluster Using Automation
How to delete a Kubernetes cluster using the DigitalOcean CLI
To delete a Kubernetes cluster via the command-line, follow these steps:
Use the token to grant doctl access to your
DigitalOcean account.
doctl auth init
Finally, delete a Kubernetes cluster with
doctl kubernetes cluster delete. The basic usage looks
like this, but you'll want to read the usage docs for more details:
Ruby developers can use DropletKit,
the official DigitalOcean V2 API client for Ruby. To delete a Kubernetes cluster with DropletKit, use the
following code:
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
resp = client.kubernetes.delete_cluster(cluster_id="da8fda8")
Destroy a Cluster Using the Control Panel
To destroy a cluster, go to the Kubernetes page in the control panel. From the cluster’s More menu, select Destroy and click Destroy. In the Destroy Kubernetes cluster dialog box, select the resources, such as load balancers and volumes, associated with the cluster to delete them automatically when the cluster is deleted. Enter the name of the cluster, then click Destroy to confirm.
You can also delete the associated load balancers and volumes manually from the control panel after the cluster is destroyed. You will continue to be billed until the resources are destroyed .
You can also use doctl or the API to delete the associated resources automatically when you destroy a cluster.