Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy controller for tiflash #2157

Merged
merged 7 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ spec:
{{- end }}
- -pd-failover-period={{ .Values.controllerManager.pdFailoverPeriod | default "5m" }}
- -tikv-failover-period={{ .Values.controllerManager.tikvFailoverPeriod | default "5m" }}
- -tiflash-failover-period={{ .Values.controllerManager.tiflashFailoverPeriod | default "5m" }}
- -tidb-failover-period={{ .Values.controllerManager.tidbFailoverPeriod | default "5m" }}
- -v={{ .Values.controllerManager.logLevel }}
{{- if .Values.testMode }}
Expand Down
2 changes: 2 additions & 0 deletions charts/tidb-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ controllerManager:
tikvFailoverPeriod: 5m
# tidb failover period default(5m)
tidbFailoverPeriod: 5m
# tiflash failover period default(5m)
tiflashFailoverPeriod: 5m
## affinity defines pod scheduling rules,affinity default settings is empty.
## please read the affinity document before set your scheduling rule:
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
Expand Down
24 changes: 13 additions & 11 deletions cmd/controller-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,17 @@ import (
)

var (
printVersion bool
workers int
autoFailover bool
pdFailoverPeriod time.Duration
tikvFailoverPeriod time.Duration
tidbFailoverPeriod time.Duration
leaseDuration = 15 * time.Second
renewDuration = 5 * time.Second
retryPeriod = 3 * time.Second
waitDuration = 5 * time.Second
printVersion bool
workers int
autoFailover bool
pdFailoverPeriod time.Duration
tikvFailoverPeriod time.Duration
tidbFailoverPeriod time.Duration
tiflashFailoverPeriod time.Duration
leaseDuration = 15 * time.Second
renewDuration = 5 * time.Second
retryPeriod = 3 * time.Second
waitDuration = 5 * time.Second
)

func init() {
Expand All @@ -72,6 +73,7 @@ func init() {
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(&tiflashFailoverPeriod, "tiflash-failover-period", time.Duration(5*time.Minute), "TiFlash failover period default(5m)")
flag.DurationVar(&tidbFailoverPeriod, "tidb-failover-period", time.Duration(5*time.Minute), "TiDB failover period")
flag.DurationVar(&controller.ResyncDuration, "resync-duration", time.Duration(30*time.Second), "Resync time of informer")
flag.BoolVar(&controller.TestMode, "test-mode", false, "whether tidb-operator run in test mode")
Expand Down Expand Up @@ -179,7 +181,7 @@ func main() {
klog.Fatalf("failed to upgrade: %v", err)
}

tcController := tidbcluster.NewController(kubeCli, cli, genericCli, informerFactory, kubeInformerFactory, autoFailover, pdFailoverPeriod, tikvFailoverPeriod, tidbFailoverPeriod)
tcController := tidbcluster.NewController(kubeCli, cli, genericCli, informerFactory, kubeInformerFactory, autoFailover, pdFailoverPeriod, tikvFailoverPeriod, tidbFailoverPeriod, tiflashFailoverPeriod)
backupController := backup.NewController(kubeCli, cli, informerFactory, kubeInformerFactory)
restoreController := restore.NewController(kubeCli, cli, informerFactory, kubeInformerFactory)
bsController := backupschedule.NewController(kubeCli, cli, informerFactory, kubeInformerFactory)
Expand Down
16 changes: 14 additions & 2 deletions docs/api-references/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
"TCPPort",
"HTTPPort",
"InternalServerHTTPPort",
"Errorlog",
"ErrorLog",
"ServerLog",
"TiDBStatusAddr",
"ServiceAddr",
"ProxyConfig",
"ClusterManagerPath",
"Flash",
"FlashStatus",
"FlashQuota",
"FlashUser",
Expand All @@ -27,7 +28,18 @@
"hideTypePatterns": [
"ParseError$",
"List$",
"DataResource"
"DataResource",
"ProxyConfig",
"^Flash$",
"FlashCluster",
"FlashStatus",
"FlashQuota",
"FlashUser",
"FlashProfile",
"FlashApplication",
"FlashProxy",
"FlashServerConfig",
"FlashRaft"
],
"externalPackages": [
{
Expand Down
Loading