Important

You are viewing the documentation for an older major version of the TiDB Operator tool (TiDB Operator v1.0).

TiDB Operator release-1.3, the latest major version of TiDB Operator, is now stable and recommended for general use. To view this page for TiDB Operator release-1.3, click here.

Destroy TiDB Clusters in Kubernetes

This document describes how to deploy TiDB clusters in Kubernetes.

To destroy a TiDB cluster in Kubernetes, run the following commands:

helm delete <release-name> --purge

The above commands only removes the runining Pod with the data still retained. If you want the data to be deleted as well, you can use the following commands:

Warning

The following commands deletes your data completely. Please be cautious.

kubectl delete pvc -n <namespace> -l app.kubernetes.io/instance=<release-name>,app.kubernetes.io/managed-by=tidb-operator
kubectl get pv -l app.kubernetes.io/namespace=<namespace>,app.kubernetes.io/managed-by=tidb-operator,app.kubernetes.io/instance=<release-name> -o name | xargs -I {} kubectl patch {} -p '{"spec":{"persistentVolumeReclaimPolicy":"Delete"}}'
Was this page helpful?