diff --git a/charts/tidb-cluster/templates/discovery-deployment.yaml b/charts/tidb-cluster/templates/discovery-deployment.yaml index df6bd7c507..01d6ef2133 100644 --- a/charts/tidb-cluster/templates/discovery-deployment.yaml +++ b/charts/tidb-cluster/templates/discovery-deployment.yaml @@ -9,6 +9,8 @@ metadata: app.kubernetes.io/component: discovery helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} spec: + strategy: + type: Recreate # don't modify this replicas replicas: 1 selector: diff --git a/pkg/manager/member/tidb_discovery_manager.go b/pkg/manager/member/tidb_discovery_manager.go index af50f638d8..12dd55622a 100644 --- a/pkg/manager/member/tidb_discovery_manager.go +++ b/pkg/manager/member/tidb_discovery_manager.go @@ -135,6 +135,7 @@ func getTidbDiscoveryDeployment(tc *v1alpha1.TidbCluster) (*appsv1.Deployment, e d := &appsv1.Deployment{ ObjectMeta: meta, Spec: appsv1.DeploymentSpec{ + Strategy: appsv1.DeploymentStrategy{Type: appsv1.RecreateDeploymentStrategyType}, Replicas: controller.Int32Ptr(1), Selector: l.LabelSelector(), Template: corev1.PodTemplateSpec{