Skip to main content
Skip table of contents

Delete a DKP Cluster with One Command

You can use a single command line entry to delete a Kubernetes cluster on any of the platforms supported by DKP. Deleting a cluster means removing the cluster, all of its nodes, and all of the platform applications that were deployed on it as part of its creation. Use this command with extreme care, as it is not reversible!

You need to delete the attachment for any clusters attached in Kommander before running the delete command.

Persistent Volumes (PVs) are not deleted automatically by design in order to preserve your data. However, they take up storage space if not deleted. You must delete PVs manually. Information for backup of a cluster and PVs is on the page in documentation called Back up your Cluster's Applications and Persistent Volumes .

With Vsphere clusters, dkp delete doesn't delete the virtual disks backing the PVs for DKP add ons. Therefore internal VMware cluster runs out of storage eventually. Theses PVs are only visible if VSAN is installed which gives users a Container Native Storage tab.

Set the environment variable to be used throughout this documentation:

CODE
export CLUSTER_NAME=cluster-example

The basic DKP delete command structure is:

CODE
dkp delete cluster --cluster-name=${CLUSTER_NAME} --self-managed --kubeconfig=${CLUSTER_NAME}.conf

When you use the --self-managed flag, the prerequisite components and resources are moved from the self-managed cluster before deleting. When you omit this flag (the default value is false) the resources are assumed to be installed in a management cluster. The default value is false, or no flag.

This command performs the following actions:

  • Creates a local bootstrap cluster

  • Moves controllers to it

  • Deletes the management cluster

  • Deletes the local bootstrap cluster

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.