From 1d7b68c3cea04285bb8597b690fca9d2e595462e Mon Sep 17 00:00:00 2001 From: DanielZhangQD Date: Fri, 27 Sep 2019 15:49:54 +0800 Subject: [PATCH 1/2] add provider version constraint for GCP and Aliyun --- deploy/aliyun/versions.tf | 7 +++++++ deploy/gcp/versions.tf | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/deploy/aliyun/versions.tf b/deploy/aliyun/versions.tf index ac97c6ac8e..0019392113 100644 --- a/deploy/aliyun/versions.tf +++ b/deploy/aliyun/versions.tf @@ -1,4 +1,11 @@ terraform { required_version = ">= 0.12" + required_providers { + alicloud = "~> 1.56" + external = "~> 1.2" + helm = "~> 0.10" + null = "~> 2.1" + template = "~> 2.1" + } } diff --git a/deploy/gcp/versions.tf b/deploy/gcp/versions.tf index ac97c6ac8e..f7999a8e96 100644 --- a/deploy/gcp/versions.tf +++ b/deploy/gcp/versions.tf @@ -1,4 +1,11 @@ terraform { required_version = ">= 0.12" + required_providers { + google = "~> 2.16" + google-beta = "~> 2.16" + external = "~> 1.2" + helm = "~> 0.10" + null = "~> 2.1" + } } From f9581ee9b8df93799f0baa7f0c4b0ef62d45e184 Mon Sep 17 00:00:00 2001 From: DanielZhangQD Date: Fri, 27 Sep 2019 21:13:20 +0800 Subject: [PATCH 2/2] Support customized values file for tidb-operator and tidb-cluster --- deploy/gcp/main.tf | 2 +- deploy/gcp/tidbclusters.tf | 2 +- deploy/gcp/variables.tf | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/deploy/gcp/main.tf b/deploy/gcp/main.tf index 8cbbc48926..e96b70be4a 100644 --- a/deploy/gcp/main.tf +++ b/deploy/gcp/main.tf @@ -50,7 +50,7 @@ module "tidb-operator" { kubeconfig_path = local.kubeconfig tidb_operator_version = var.tidb_operator_version maintenance_window_start_time = var.maintenance_window_start_time - operator_helm_values = var.operator_helm_values + operator_helm_values = var.operator_helm_values == "" ? var.operator_helm_values_file == "" ? "" : file(var.operator_helm_values_file) : var.operator_helm_values } module "bastion" { diff --git a/deploy/gcp/tidbclusters.tf b/deploy/gcp/tidbclusters.tf index fc919d6a31..8ff5efb8c3 100644 --- a/deploy/gcp/tidbclusters.tf +++ b/deploy/gcp/tidbclusters.tf @@ -40,5 +40,5 @@ module "default-tidb-cluster" { tidb_node_count = var.tidb_count monitor_node_count = var.monitor_count tikv_local_ssd_count = var.tikv_local_ssd_count - override_values = var.override_values + override_values = var.override_values == "" ? var.override_values_file == "" ? "" : file(var.override_values_file) : var.override_values } diff --git a/deploy/gcp/variables.tf b/deploy/gcp/variables.tf index 9b2c906933..e789993eaf 100644 --- a/deploy/gcp/variables.tf +++ b/deploy/gcp/variables.tf @@ -42,6 +42,11 @@ variable "operator_helm_values" { default = "" } +variable "operator_helm_values_file" { + description = "The helm values file for TiDB Operator, path is relative to current working dir" + default = "" +} + variable "create_vpc" { default = true } @@ -129,3 +134,7 @@ variable "override_values" { description = "YAML formatted values that will be passed in to the tidb-cluster helm release" default = "" } +variable "override_values_file" { + description = "The helm values file for TiDB Cluster, path is relative to current working dir" + default = "" +}