From 37a7d570bb5e54593766fd6b0565fd38ecabeda9 Mon Sep 17 00:00:00 2001 From: weekface Date: Mon, 15 Jun 2020 12:10:30 +0800 Subject: [PATCH] Change tidb-discovery strategy type to `Recreate` (#2701) --- charts/tidb-cluster/templates/discovery-deployment.yaml | 2 ++ pkg/manager/member/tidb_discovery_manager.go | 1 + 2 files changed, 3 insertions(+) diff --git a/charts/tidb-cluster/templates/discovery-deployment.yaml b/charts/tidb-cluster/templates/discovery-deployment.yaml index df6bd7c5074..01d6ef21333 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 af50f638d87..12dd55622a5 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{