From 31c5188f50c76a319808d24399497a685b14f229 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Thu, 22 Aug 2019 16:33:55 +0800 Subject: [PATCH] support zonal/multi-zonal clusters --- deploy/gcp/examples/multi-zonal.tfvars | 13 ++++ deploy/gcp/examples/single-zonal.tfvars | 13 ++++ deploy/gcp/examples/tidb-customized.tfvars | 25 ++++++++ deploy/gcp/main.tf | 9 ++- deploy/gcp/tidbclusters.tf | 8 ++- deploy/gcp/variables.tf | 60 +++++++++++++++---- deploy/modules/gcp/tidb-cluster/data.tf | 4 +- deploy/modules/gcp/tidb-cluster/main.tf | 2 +- deploy/modules/gcp/tidb-cluster/variables.tf | 5 ++ deploy/modules/gcp/tidb-operator/main.tf | 16 +++-- deploy/modules/gcp/tidb-operator/outputs.tf | 2 +- deploy/modules/gcp/tidb-operator/variables.tf | 14 +++-- 12 files changed, 146 insertions(+), 25 deletions(-) create mode 100644 deploy/gcp/examples/multi-zonal.tfvars create mode 100644 deploy/gcp/examples/single-zonal.tfvars create mode 100644 deploy/gcp/examples/tidb-customized.tfvars diff --git a/deploy/gcp/examples/multi-zonal.tfvars b/deploy/gcp/examples/multi-zonal.tfvars new file mode 100644 index 00000000000..17aa938cc04 --- /dev/null +++ b/deploy/gcp/examples/multi-zonal.tfvars @@ -0,0 +1,13 @@ +# +# This will create a zonal cluster in zone us-central1-b with one additional zone. +# Work nodes will be created in primary zone us-central1-b and additional zone us-central1-c. +# +gke_name = "multi-zonal" +vpc_name = "multi-zonal" +location = "us-central1-b" +pd_instance_type = "n1-standard-2" +tikv_instance_type = "n1-highmem-4" +tidb_instance_type = "n1-standard-8" +node_locations = [ + "us-central1-c" +] diff --git a/deploy/gcp/examples/single-zonal.tfvars b/deploy/gcp/examples/single-zonal.tfvars new file mode 100644 index 00000000000..4b073e6e2c0 --- /dev/null +++ b/deploy/gcp/examples/single-zonal.tfvars @@ -0,0 +1,13 @@ +# +# This will create a zonal cluster in zone us-central1-b without additional zones. +# Work nodes will be created in a single zone only. +# +gke_name = "single-zonal" +vpc_name = "single-zonal" +location = "us-central1-b" +pd_instance_type = "n1-standard-2" +tikv_instance_type = "n1-highmem-4" +tidb_instance_type = "n1-standard-8" +pd_count = 3 +tikv_count = 3 +tidb_count = 3 diff --git a/deploy/gcp/examples/tidb-customized.tfvars b/deploy/gcp/examples/tidb-customized.tfvars new file mode 100644 index 00000000000..a1a525ba3e4 --- /dev/null +++ b/deploy/gcp/examples/tidb-customized.tfvars @@ -0,0 +1,25 @@ +pd_instance_type = "n1-standard-2" +tikv_instance_type = "n1-highmem-4" +tidb_instance_type = "n1-standard-8" + +# specify tidb version +tidb_version = "3.0.2" + +# override tidb cluster values +override_values = <