From 79a7a3bfc119c3bf877f619c10eaaa92422a80d8 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Thu, 15 Aug 2019 17:37:10 +0800 Subject: [PATCH] Able to configure image type --- deploy/modules/gcp/tidb-cluster/main.tf | 3 +++ deploy/modules/gcp/tidb-cluster/variables.tf | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/deploy/modules/gcp/tidb-cluster/main.tf b/deploy/modules/gcp/tidb-cluster/main.tf index 3226371026..c4100ae5aa 100644 --- a/deploy/modules/gcp/tidb-cluster/main.tf +++ b/deploy/modules/gcp/tidb-cluster/main.tf @@ -15,6 +15,7 @@ resource "google_container_node_pool" "pd_pool" { node_config { machine_type = var.pd_instance_type + image_type = var.pd_image_type local_ssd_count = 0 taint { @@ -47,6 +48,7 @@ resource "google_container_node_pool" "tikv_pool" { node_config { machine_type = var.tikv_instance_type + image_type = var.tikv_image_type // This value cannot be changed (instead a new node pool is needed) // 1 SSD is 375 GiB local_ssd_count = 1 @@ -83,6 +85,7 @@ resource "google_container_node_pool" "tidb_pool" { node_config { machine_type = var.tidb_instance_type + image_type = var.tidb_image_type taint { effect = "NO_SCHEDULE" diff --git a/deploy/modules/gcp/tidb-cluster/variables.tf b/deploy/modules/gcp/tidb-cluster/variables.tf index 6aa343dcd4..3087da6834 100644 --- a/deploy/modules/gcp/tidb-cluster/variables.tf +++ b/deploy/modules/gcp/tidb-cluster/variables.tf @@ -44,3 +44,18 @@ variable "tidb_instance_type" {} variable "monitor_instance_type" { default = "n1-standard-2" } + +variable "pd_image_type" { + description = "PD image type, avaiable: UBUNTU/COS" + default = "COS" +} + +variable "tidb_image_type" { + description = "TiDB image type, avaiable: UBUNTU/COS" + default = "COS" +} + +variable "tikv_image_type" { + description = "TiKV image type, avaiable: UBUNTU/COS" + default = "COS" +}