Skip to content

Commit 7f51a01

Browse files
committed
Reverting location back to zone and regions. Reverting node_pool test case. Updating documentation
1 parent 892389d commit 7f51a01

File tree

15 files changed

+25
-31
lines changed

15 files changed

+25
-31
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
197197
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
198198
#### Terraform and Plugins
199199
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
200+
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) v2.3, v2.6, v2.7
200201
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) v2.3, v2.6, v2.7
201202

202203
### Configure a Service Account

autogen/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,8 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
137137
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
138138
#### Terraform and Plugins
139139
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
140-
{% if private_cluster %}
141140
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) v2.3, v2.6, v2.7
142-
{% else %}
143141
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) v2.3, v2.6, v2.7
144-
{% endif %}
145142

146143
### Configure a Service Account
147144
In order to execute this module you must have a Service Account with the

autogen/cluster_regional.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "google_container_cluster" "primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
location = "${var.region}"
29+
region = "${var.region}"
3030
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -124,7 +124,7 @@ resource "google_container_node_pool" "pools" {
124124
count = "${var.regional ? length(var.node_pools) : 0}"
125125
name = "${lookup(var.node_pools[count.index], "name")}"
126126
project = "${var.project_id}"
127-
location = "${var.region}"
127+
region = "${var.region}"
128128
cluster = "${google_container_cluster.primary.name}"
129129
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_regional)}"
130130
initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}"

autogen/cluster_zonal.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "google_container_cluster" "zonal_primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
location = "${var.zones[0]}"
29+
zone = "${var.zones[0]}"
3030
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -124,7 +124,7 @@ resource "google_container_node_pool" "zonal_pools" {
124124
count = "${var.regional ? 0 : length(var.node_pools)}"
125125
name = "${lookup(var.node_pools[count.index], "name")}"
126126
project = "${var.project_id}"
127-
location = "${var.zones[0]}"
127+
zone = "${var.zones[0]}"
128128
cluster = "${google_container_cluster.zonal_primary.name}"
129129
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_zonal)}"
130130
initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}"

autogen/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ locals {
168168
*****************************************/
169169
data "google_container_engine_versions" "region" {
170170
provider = "google-beta"
171-
location = "${var.region}"
171+
region = "${var.region}"
172172
project = "${var.project_id}"
173173
}
174174

@@ -177,7 +177,7 @@ data "google_container_engine_versions" "zone" {
177177
//
178178
// data.google_container_engine_versions.zone: Cannot determine zone: set in this resource, or set provider-level zone.
179179
//
180-
location = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
180+
zone = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
181181

182182
project = "${var.project_id}"
183183
}

cluster_regional.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "google_container_cluster" "primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
location = "${var.region}"
29+
region = "${var.region}"
3030
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -113,7 +113,7 @@ resource "google_container_node_pool" "pools" {
113113
count = "${var.regional ? length(var.node_pools) : 0}"
114114
name = "${lookup(var.node_pools[count.index], "name")}"
115115
project = "${var.project_id}"
116-
location = "${var.region}"
116+
region = "${var.region}"
117117
cluster = "${google_container_cluster.primary.name}"
118118
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_regional)}"
119119
initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}"

cluster_zonal.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "google_container_cluster" "zonal_primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
location = "${var.zones[0]}"
29+
zone = "${var.zones[0]}"
3030
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -113,7 +113,7 @@ resource "google_container_node_pool" "zonal_pools" {
113113
count = "${var.regional ? 0 : length(var.node_pools)}"
114114
name = "${lookup(var.node_pools[count.index], "name")}"
115115
project = "${var.project_id}"
116-
location = "${var.zones[0]}"
116+
zone = "${var.zones[0]}"
117117
cluster = "${google_container_cluster.zonal_primary.name}"
118118
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_zonal)}"
119119
initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}"

examples/simple_regional_private/main.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ locals {
1818
cluster_type = "simple-regional-private"
1919
}
2020

21-
provider "google" {
22-
version = "~> 2.7.0"
23-
region = "${var.region}"
24-
}
25-
2621
provider "google-beta" {
2722
version = "~> 2.7.0"
2823
region = "${var.region}"

examples/simple_zonal_private/main.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ locals {
1818
cluster_type = "simple-regional-private"
1919
}
2020

21-
provider "google" {
22-
version = "~> 2.7.0"
23-
region = "${var.region}"
24-
}
25-
2621
provider "google-beta" {
2722
version = "~> 2.7.0"
2823
region = "${var.region}"

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ locals {
152152
*****************************************/
153153
data "google_container_engine_versions" "region" {
154154
provider = "google-beta"
155-
location = "${var.region}"
155+
region = "${var.region}"
156156
project = "${var.project_id}"
157157
}
158158

@@ -161,7 +161,7 @@ data "google_container_engine_versions" "zone" {
161161
//
162162
// data.google_container_engine_versions.zone: Cannot determine zone: set in this resource, or set provider-level zone.
163163
//
164-
location = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
164+
zone = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
165165

166166
project = "${var.project_id}"
167167
}

modules/private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
208208
#### Terraform and Plugins
209209
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
210210
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) v2.3, v2.6, v2.7
211+
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) v2.3, v2.6, v2.7
211212

212213
### Configure a Service Account
213214
In order to execute this module you must have a Service Account with the

modules/private-cluster/cluster_regional.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "google_container_cluster" "primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
location = "${var.region}"
29+
region = "${var.region}"
3030
node_locations = ["${coalescelist(compact(var.zones), sort(random_shuffle.available_zones.result))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -120,7 +120,7 @@ resource "google_container_node_pool" "pools" {
120120
count = "${var.regional ? length(var.node_pools) : 0}"
121121
name = "${lookup(var.node_pools[count.index], "name")}"
122122
project = "${var.project_id}"
123-
location = "${var.region}"
123+
region = "${var.region}"
124124
cluster = "${google_container_cluster.primary.name}"
125125
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_regional)}"
126126
initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}"

modules/private-cluster/cluster_zonal.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "google_container_cluster" "zonal_primary" {
2626
description = "${var.description}"
2727
project = "${var.project_id}"
2828

29-
location = "${var.zones[0]}"
29+
zone = "${var.zones[0]}"
3030
node_locations = ["${slice(var.zones,1,length(var.zones))}"]
3131

3232
network = "${replace(data.google_compute_network.gke_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"
@@ -120,7 +120,7 @@ resource "google_container_node_pool" "zonal_pools" {
120120
count = "${var.regional ? 0 : length(var.node_pools)}"
121121
name = "${lookup(var.node_pools[count.index], "name")}"
122122
project = "${var.project_id}"
123-
location = "${var.zones[0]}"
123+
zone = "${var.zones[0]}"
124124
cluster = "${google_container_cluster.zonal_primary.name}"
125125
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_zonal)}"
126126
initial_node_count = "${lookup(var.node_pools[count.index], "initial_node_count", lookup(var.node_pools[count.index], "min_count", 1))}"

modules/private-cluster/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ locals {
161161
*****************************************/
162162
data "google_container_engine_versions" "region" {
163163
provider = "google-beta"
164-
location = "${var.region}"
164+
region = "${var.region}"
165165
project = "${var.project_id}"
166166
}
167167

@@ -170,7 +170,7 @@ data "google_container_engine_versions" "zone" {
170170
//
171171
// data.google_container_engine_versions.zone: Cannot determine zone: set in this resource, or set provider-level zone.
172172
//
173-
location = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
173+
zone = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
174174

175175
project = "${var.project_id}"
176176
}

test/integration/node_pool/controls/kubectl.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
key: "all-pools-example",
8080
value: "true",
8181
},
82+
{
83+
effect: "NoSchedule",
84+
key: "nvidia.com/gpu",
85+
value: "present",
86+
},
8287
])
8388
end
8489
end

0 commit comments

Comments
 (0)