Restart a TiDB Cluster in Kubernetes

This document describes how to forcibly restart a TiDB cluster in the Kubernetes cluster, including restarting a Pod, restarting all Pods of a component, and restarting all Pods of the TiDB cluster.

Forcibly restart a Pod

Execute the following command to forcibly restart a Pod:

kubectl delete pod -n <namespace> <pod-name>

Forcibly restart all Pods of a component

Execute the following command to check the Pod list of a component:

kubectl get pod -n <namespace> -l app.kubernetes.io/component=<component-name>

Execute the following command to forcibly restart all Pods of a component:

kubectl delete pod -n <namespace> -l app.kubernetes.io/component=<component-name>

Forcibly restart all Pods of the TiDB cluster

Execute the following command to check the Pod list of the TiDB cluster (including monitor and discovery):

kubectl get pod -n <namespace> -l app.kubernetes.io/instance=<tidb-cluster-name>

Execute the following command to forcibly restart all Pods of the TiDB cluster (including monitor and discovery):

kubectl delete pod -n <namespace> -l app.kubernetes.io/instance=<tidb-cluster-name>