- Introduction
- Get Started
- Deploy
- In Self-Managed Kubernetes
- In Public Cloud Kubernetes
- Deploy TiDB on ARM64 Machines
- Deploy TiFlash to Explore TiDB HTAP
- Deploy TiDB Across Multiple Kubernetes Clusters
- Deploy a Heterogeneous TiDB Cluster
- Deploy TiCDC
- Deploy TiDB Binlog
- Monitor and Alert
- Migrate
- Import Data
- Migrate from MySQL
- Migrate TiDB to Kubernetes
- Manage
- Secure
- Scale
- Upgrade
- Upgrade a TiDB Cluster
- Upgrade TiDB Operator
- Backup and Restore
- Overview
- Backup and Restore Custom Resources
- Grant Permissions to Remote Storage
- Amazon S3 Compatible Storage
- Google Cloud Storage
- Persistent Volumes
- Maintain
- Restart a TiDB Cluster
- Destroy a TiDB Cluster
- View TiDB Logs
- Modify TiDB Cluster Configuration
- Configure Automatic Failover
- Pause Sync of TiDB Cluster
- Maintain Different TiDB Clusters Separately Using Multiple TiDB Operator
- Maintain Kubernetes Nodes
- Migrate from Helm 2 to Helm 3
- Replace Nodes for a TiDB Cluster
- Disaster Recovery
- Troubleshoot
- FAQs
- Reference
- Release Notes
- v1.2
- v1.1
- v1.0
- v0
Destroy TiDB Clusters in Kubernetes
This document describes how to destroy TiDB clusters in Kubernetes.
Destroy a TiDB cluster managed by TidbCluster
To destroy a TiDB cluster managed by TidbCluster
, run the following command:
kubectl delete tc ${cluster_name} -n ${namespace}
If you deploy the monitor in the cluster using TidbMonitor
, run the following command to delete the monitor component:
kubectl delete tidbmonitor ${tidb_monitor_name} -n ${namespace}
Destroy a TiDB cluster managed by Helm
To destroy a TiDB cluster managed by Helm, run the following command:
helm uninstall ${cluster_name} -n ${namespace}
Delete data
The above commands that destroy the cluster only remove the running Pod, but the data is still retained. If you want to delete the data as well, use the following commands:
Warning
The following commands delete your data completely. Please be cautious.
To ensure data safety, do not delete PVs on any circumstances, unless you are familiar with the working principles of PVs.
kubectl delete pvc -n ${namespace} -l app.kubernetes.io/instance=${cluster_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=${cluster_name} -o name | xargs -I {} kubectl patch {} -p '{"spec":{"persistentVolumeReclaimPolicy":"Delete"}}'
Was this page helpful?