Skip to content

Commit 5423f41

Browse files
committed
Reverting location back to zone and regions. Reverting node_pool test case. Updating documentation
1 parent 171a71c commit 5423f41

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/", "")}"
@@ -125,7 +125,7 @@ resource "google_container_node_pool" "pools" {
125125
count = "${var.regional ? length(var.node_pools) : 0}"
126126
name = "${lookup(var.node_pools[count.index], "name")}"
127127
project = "${var.project_id}"
128-
location = "${var.region}"
128+
region = "${var.region}"
129129
cluster = "${google_container_cluster.primary.name}"
130130
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_regional)}"
131131
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/", "")}"
@@ -125,7 +125,7 @@ resource "google_container_node_pool" "zonal_pools" {
125125
count = "${var.regional ? 0 : length(var.node_pools)}"
126126
name = "${lookup(var.node_pools[count.index], "name")}"
127127
project = "${var.project_id}"
128-
location = "${var.zones[0]}"
128+
zone = "${var.zones[0]}"
129129
cluster = "${google_container_cluster.zonal_primary.name}"
130130
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_zonal)}"
131131
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
@@ -178,7 +178,7 @@ locals {
178178
*****************************************/
179179
data "google_container_engine_versions" "region" {
180180
provider = "google-beta"
181-
location = "${var.region}"
181+
region = "${var.region}"
182182
project = "${var.project_id}"
183183
}
184184

@@ -187,7 +187,7 @@ data "google_container_engine_versions" "zone" {
187187
//
188188
// data.google_container_engine_versions.zone: Cannot determine zone: set in this resource, or set provider-level zone.
189189
//
190-
location = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
190+
zone = "${var.zones[0] == "" ? data.google_compute_zones.available.names[0] : var.zones[0]}"
191191

192192
project = "${var.project_id}"
193193
}

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
@@ -210,6 +210,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
210210
#### Terraform and Plugins
211211
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
212212
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) v2.3, v2.6, v2.7
213+
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) v2.3, v2.6, v2.7
213214

214215
### Configure a Service Account
215216
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/", "")}"
@@ -121,7 +121,7 @@ resource "google_container_node_pool" "pools" {
121121
count = "${var.regional ? length(var.node_pools) : 0}"
122122
name = "${lookup(var.node_pools[count.index], "name")}"
123123
project = "${var.project_id}"
124-
location = "${var.region}"
124+
region = "${var.region}"
125125
cluster = "${google_container_cluster.primary.name}"
126126
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_regional)}"
127127
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/", "")}"
@@ -121,7 +121,7 @@ resource "google_container_node_pool" "zonal_pools" {
121121
count = "${var.regional ? 0 : length(var.node_pools)}"
122122
name = "${lookup(var.node_pools[count.index], "name")}"
123123
project = "${var.project_id}"
124-
location = "${var.zones[0]}"
124+
zone = "${var.zones[0]}"
125125
cluster = "${google_container_cluster.zonal_primary.name}"
126126
version = "${lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(var.node_pools[count.index], "version", local.node_version_zonal)}"
127127
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
@@ -167,7 +167,7 @@ locals {
167167
*****************************************/
168168
data "google_container_engine_versions" "region" {
169169
provider = "google-beta"
170-
location = "${var.region}"
170+
region = "${var.region}"
171171
project = "${var.project_id}"
172172
}
173173

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

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

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)