Skip to content

Commit 85d6691

Browse files
authored
Merge branch 'master' into ops-31505
2 parents f04b5c5 + 8c096da commit 85d6691

File tree

21 files changed

+54
-17
lines changed

21 files changed

+54
-17
lines changed

cluster_regional.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ resource "google_container_node_pool" "pools" {
112112
machine_type = "${lookup(var.node_pools[count.index], "machine_type", "n1-standard-2")}"
113113
labels = "${merge(map("cluster_name", var.name), map("node_pool", lookup(var.node_pools[count.index], "name")), var.node_pools_labels["all"], var.node_pools_labels[lookup(var.node_pools[count.index], "name")])}"
114114
taint = "${concat(var.node_pools_taints["all"], var.node_pools_taints[lookup(var.node_pools[count.index], "name")])}"
115-
tags = "${concat(list("gke-${var.name}"), list("gke-${var.name}-${lookup(var.node_pools[count.index], "name")}"), var.node_pools_tags["all"], var.node_pools_tags[lookup(var.node_pools[count.index], "name")])}"
115+
tags = ["${concat(list("gke-${var.name}"), list("gke-${var.name}-${lookup(var.node_pools[count.index], "name")}"), var.node_pools_tags["all"], var.node_pools_tags[lookup(var.node_pools[count.index], "name")])}"]
116116

117117
disk_size_gb = "${lookup(var.node_pools[count.index], "disk_size_gb", 100)}"
118118
disk_type = "${lookup(var.node_pools[count.index], "disk_type", "pd-standard")}"

cluster_zonal.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ resource "google_container_node_pool" "zonal_pools" {
112112
machine_type = "${lookup(var.node_pools[count.index], "machine_type", "n1-standard-2")}"
113113
labels = "${merge(map("cluster_name", var.name), map("node_pool", lookup(var.node_pools[count.index], "name")), var.node_pools_labels["all"], var.node_pools_labels[lookup(var.node_pools[count.index], "name")])}"
114114
taint = "${concat(var.node_pools_taints["all"], var.node_pools_taints[lookup(var.node_pools[count.index], "name")])}"
115-
tags = "${concat(list("gke-${var.name}"), list("gke-${var.name}-${lookup(var.node_pools[count.index], "name")}"), var.node_pools_tags["all"], var.node_pools_tags[lookup(var.node_pools[count.index], "name")])}"
115+
tags = ["${concat(list("gke-${var.name}"), list("gke-${var.name}-${lookup(var.node_pools[count.index], "name")}"), var.node_pools_tags["all"], var.node_pools_tags[lookup(var.node_pools[count.index], "name")])}"]
116116

117117
disk_size_gb = "${lookup(var.node_pools[count.index], "disk_size_gb", 100)}"
118118
disk_type = "${lookup(var.node_pools[count.index], "disk_type", "pd-standard")}"

examples/deploy_service/main.tf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ provider "kubernetes" {
3333
data "google_client_config" "default" {}
3434

3535
module "gke" {
36-
source = "../../"
37-
project_id = "${var.project_id}"
38-
name = "${local.cluster_type}-cluster"
39-
region = "${var.region}"
40-
network = "${var.network}"
41-
subnetwork = "${var.subnetwork}"
36+
source = "../../"
37+
project_id = "${var.project_id}"
38+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
39+
region = "${var.region}"
40+
network = "${var.network}"
41+
subnetwork = "${var.subnetwork}"
42+
4243
ip_range_pods = "${var.ip_range_pods}"
4344
ip_range_services = "${var.ip_range_services}"
4445
kubernetes_version = "1.11.5-gke.4"

examples/deploy_service/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
region = "${var.region}"
3131
network = "${var.network}"
3232
subnetwork = "${var.subnetwork}"

examples/node_pool/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/shared_vpc/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
region = "${var.region}"
3131
network = "${var.network}"
3232
network_project_id = "${var.network_project_id}"

examples/shared_vpc/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/simple_regional/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
regional = true
3131
region = "${var.region}"
3232
network = "${var.network}"

examples/simple_regional/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/simple_zonal/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
regional = false
3131
region = "${var.region}"
3232
zones = "${var.zones}"

examples/simple_zonal/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

examples/stub_domains/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ provider "google" {
2626
module "gke" {
2727
source = "../../"
2828
project_id = "${var.project_id}"
29-
name = "${local.cluster_type}-cluster"
29+
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
3030
region = "${var.region}"
3131
network = "${var.network}"
3232
subnetwork = "${var.subnetwork}"

examples/stub_domains/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ variable "credentials_path" {
2222
description = "The path to the GCP credentials JSON file"
2323
}
2424

25+
variable "cluster_name_suffix" {
26+
description = "A suffix to append to the default cluster name"
27+
default = ""
28+
}
29+
2530
variable "region" {
2631
description = "The region to host the cluster in"
2732
}

test/fixtures/deploy_service/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

test/fixtures/node_pool/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

test/fixtures/shared_vpc/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
network_project_id = "${var.project_id}"

test/fixtures/simple_regional/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

test/fixtures/simple_zonal/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
zones = ["${var.zones}"]
2425
network = "${google_compute_network.main.name}"

test/fixtures/stub_domains/example.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module "example" {
1919

2020
project_id = "${var.project_id}"
2121
credentials_path = "${local.credentials_path}"
22+
cluster_name_suffix = "-${random_string.suffix.result}"
2223
region = "${var.region}"
2324
network = "${google_compute_network.main.name}"
2425
subnetwork = "${google_compute_subnetwork.main.name}"

test/integration/node_pool/controls/gcloud.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@
128128
"tags" => match_array([
129129
"all-node-example",
130130
"pool-01-example",
131-
"gke-node-pool-cluster",
132-
"gke-node-pool-cluster-pool-01",
131+
"gke-#{cluster_name}",
132+
"gke-#{cluster_name}-pool-01",
133133
]),
134134
),
135135
)
@@ -245,8 +245,8 @@
245245
"config" => including(
246246
"tags" => match_array([
247247
"all-node-example",
248-
"gke-node-pool-cluster",
249-
"gke-node-pool-cluster-pool-02",
248+
"gke-#{cluster_name}",
249+
"gke-#{cluster_name}-pool-02",
250250
])
251251
),
252252
)

0 commit comments

Comments
 (0)