diff --git a/charts/tidb-operator/templates/controller-manager-deployment.yaml b/charts/tidb-operator/templates/controller-manager-deployment.yaml index aa5e7a72d19..b848b89c22a 100644 --- a/charts/tidb-operator/templates/controller-manager-deployment.yaml +++ b/charts/tidb-operator/templates/controller-manager-deployment.yaml @@ -35,7 +35,7 @@ spec: - /usr/local/bin/tidb-controller-manager - -default-storage-class-name={{ .Values.defaultStorageClassName }} - -cluster-scoped={{ .Values.clusterScoped }} - - -auto-failover={{ .Values.controllerManager.autoFailover | default false }} + - -auto-failover={{ .Values.controllerManager.autoFailover | default true }} - -pd-failover-period={{ .Values.controllerManager.pdFailoverPeriod | default "5m" }} - -tikv-failover-period={{ .Values.controllerManager.tikvFailoverPeriod | default "5m" }} - -tidb-failover-period={{ .Values.controllerManager.tidbFailoverPeriod | default "5m" }} diff --git a/charts/tidb-operator/values.yaml b/charts/tidb-operator/values.yaml index 17790363c9f..becca8cb334 100644 --- a/charts/tidb-operator/values.yaml +++ b/charts/tidb-operator/values.yaml @@ -29,7 +29,7 @@ controllerManager: cpu: 80m memory: 50Mi # autoFailover is whether tidb-operator should auto failover when failure occurs - autoFailover: false + autoFailover: true # pd failover period default(5m) pdFailoverPeriod: 5m # tikv failover period default(5m) diff --git a/cmd/controller-manager/main.go b/cmd/controller-manager/main.go index df81c20e32f..baedda07936 100644 --- a/cmd/controller-manager/main.go +++ b/cmd/controller-manager/main.go @@ -58,7 +58,7 @@ func init() { flag.IntVar(&workers, "workers", 5, "The number of workers that are allowed to sync concurrently. Larger number = more responsive management, but more CPU (and network) load") flag.BoolVar(&controller.ClusterScoped, "cluster-scoped", true, "Whether tidb-operator should manage kubernetes cluster wide TiDB Clusters") flag.StringVar(&controller.DefaultStorageClassName, "default-storage-class-name", "standard", "Default storage class name") - flag.BoolVar(&autoFailover, "auto-failover", false, "Auto failover") + flag.BoolVar(&autoFailover, "auto-failover", true, "Auto failover") flag.DurationVar(&pdFailoverPeriod, "pd-failover-period", time.Duration(5*time.Minute), "PD failover period default(5m)") flag.DurationVar(&tikvFailoverPeriod, "tikv-failover-period", time.Duration(5*time.Minute), "TiKV failover period default(5m)") flag.DurationVar(&tidbFailoverPeriod, "tidb-failover-period", time.Duration(5*time.Minute), "TiDB failover period") diff --git a/images/tidb-operator-e2e/tidb-operator-values.yaml b/images/tidb-operator-e2e/tidb-operator-values.yaml index e6789ad4ee7..2d7f0b61676 100644 --- a/images/tidb-operator-e2e/tidb-operator-values.yaml +++ b/images/tidb-operator-e2e/tidb-operator-values.yaml @@ -29,7 +29,7 @@ controllerManager: cpu: 80m memory: 50Mi # autoFailover is whether tidb-operator should auto failover when failure occurs - autoFailover: false + autoFailover: true # pd failover period default(5m) pdFailoverPeriod: 5m # tidb failover period default(5m)