Skip to content

Commit e5a7267

Browse files
authored
Merge pull request #3 from terraform-google-modules/master
update
2 parents be5e130 + 63c8b6f commit e5a7267

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1404
-335
lines changed

.kitchen.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@ suites:
5252
systems:
5353
- name: simple_regional
5454
backend: local
55+
- name: "private_zonal_with_networking"
56+
driver:
57+
root_module_directory: test/fixtures/private_zonal_with_networking
58+
verifier:
59+
systems:
60+
- name: private_zonal_with_networking
61+
backend: local
62+
controls:
63+
- gcloud
64+
- name: private_zonal_with_networking
65+
backend: local
66+
controls:
67+
- subnet
68+
- name: network
69+
backend: gcp
70+
controls:
71+
- network
5572
- name: "simple_regional_with_networking"
5673
driver:
5774
root_module_directory: test/fixtures/simple_regional_with_networking

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ Extending the adopted spec, each change should have a link to its corresponding
1414
* Support for setting node_locations on node pools. [#303]
1515
* Fix for specifying `node_count` on node pools when autoscaling is disabled. [#311]
1616
* Added submodule for installing Anthos Config Management. [#268]
17+
* Support for `local_ssd_count` in node pool configuration. [#244]
18+
* Wait for cluster to be ready before returning endpoint. [#340]
19+
20+
### Removed
21+
22+
* **Breaking**: Removed support for enabling the Kubernetes dashboard, as this is deprecated on GKE. [#337]
1723

1824
## [v5.1.1] - 2019-10-25
1925

@@ -228,6 +234,8 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
228234
[v0.3.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.2.0...v0.3.0
229235
[v0.2.0]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/compare/v0.1.0...v0.2.0
230236

237+
[#337]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/337
238+
[#340]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/340
231239
[#268]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/268
232240
[#311]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/311
233241
[#303]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/303
@@ -245,6 +253,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
245253
[#238]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/238
246254
[#241]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/241
247255
[#250]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/250
256+
[#244]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/244
248257
[#236]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/236
249258
[#217]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/217
250259
[#234]: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/234

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.4.6
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module "gke" {
3434
ip_range_services = "us-central1-01-gke-01-services"
3535
http_load_balancing = false
3636
horizontal_pod_autoscaling = true
37-
kubernetes_dashboard = true
3837
network_policy = true
3938
4039
node_pools = [
@@ -43,6 +42,7 @@ module "gke" {
4342
machine_type = "n1-standard-2"
4443
min_count = 1
4544
max_count = 100
45+
local_ssd_count = 0
4646
disk_size_gb = 100
4747
disk_type = "pd-standard"
4848
image_type = "COS"
@@ -146,7 +146,6 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
146146
| ip\_range\_pods | The _name_ of the secondary subnet ip range to use for pods | string | n/a | yes |
147147
| ip\_range\_services | The _name_ of the secondary subnet range to use for services | string | n/a | yes |
148148
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | bool | `"false"` | no |
149-
| kubernetes\_dashboard | Enable kubernetes dashboard addon | bool | `"false"` | no |
150149
| kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. | string | `"latest"` | no |
151150
| logging\_service | The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none | string | `"logging.googleapis.com"` | no |
152151
| maintenance\_start\_time | Time window specified for daily maintenance operations in RFC3339 format | string | `"05:00"` | no |
@@ -184,7 +183,6 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
184183
| endpoint | Cluster endpoint |
185184
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
186185
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
187-
| kubernetes\_dashboard\_enabled | Whether kubernetes dashboard enabled |
188186
| location | Cluster location (region if regional cluster, zone if zonal cluster) |
189187
| logging\_service | Logging service used |
190188
| master\_authorized\_networks\_config | Networks from which access to master is permitted |

autogen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ module "gke" {
3939
ip_range_services = "us-central1-01-gke-01-services"
4040
http_load_balancing = false
4141
horizontal_pod_autoscaling = true
42-
kubernetes_dashboard = true
4342
network_policy = true
4443
{% if private_cluster %}
4544
enable_private_endpoint = true
@@ -60,6 +59,7 @@ module "gke" {
6059
{% endif %}
6160
min_count = 1
6261
max_count = 100
62+
local_ssd_count = 0
6363
disk_size_gb = 100
6464
disk_type = "pd-standard"
6565
image_type = "COS"
File renamed without changes.

autogen/cluster.tf renamed to autogen/cluster.tf.tmpl

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ resource "google_container_cluster" "primary" {
119119
disabled = ! var.horizontal_pod_autoscaling
120120
}
121121

122-
kubernetes_dashboard {
123-
disabled = ! var.kubernetes_dashboard
124-
}
125-
126122
network_policy_config {
127123
disabled = ! var.network_policy
128124
}
@@ -252,10 +248,10 @@ resource "random_id" "name" {
252248
labels = join(",",
253249
sort(
254250
concat(
255-
keys(var.node_pools_labels["all"]),
256-
values(var.node_pools_labels["all"]),
257-
keys(var.node_pools_labels[var.node_pools[count.index]["name"]]),
258-
values(var.node_pools_labels[var.node_pools[count.index]["name"]])
251+
keys(local.node_pools_labels["all"]),
252+
values(local.node_pools_labels["all"]),
253+
keys(local.node_pools_labels[var.node_pools[count.index]["name"]]),
254+
values(local.node_pools_labels[var.node_pools[count.index]["name"]])
259255
)
260256
)
261257
)
@@ -264,10 +260,10 @@ resource "random_id" "name" {
264260
metadata = join(",",
265261
sort(
266262
concat(
267-
keys(var.node_pools_metadata["all"]),
268-
values(var.node_pools_metadata["all"]),
269-
keys(var.node_pools_metadata[var.node_pools[count.index]["name"]]),
270-
values(var.node_pools_metadata[var.node_pools[count.index]["name"]])
263+
keys(local.node_pools_metadata["all"]),
264+
values(local.node_pools_metadata["all"]),
265+
keys(local.node_pools_metadata[var.node_pools[count.index]["name"]]),
266+
values(local.node_pools_metadata[var.node_pools[count.index]["name"]])
271267
)
272268
)
273269
)
@@ -276,8 +272,8 @@ resource "random_id" "name" {
276272
oauth_scopes = join(",",
277273
sort(
278274
concat(
279-
var.node_pools_oauth_scopes["all"],
280-
var.node_pools_oauth_scopes[var.node_pools[count.index]["name"]]
275+
local.node_pools_oauth_scopes["all"],
276+
local.node_pools_oauth_scopes[var.node_pools[count.index]["name"]]
281277
)
282278
)
283279
)
@@ -286,8 +282,8 @@ resource "random_id" "name" {
286282
tags = join(",",
287283
sort(
288284
concat(
289-
var.node_pools_tags["all"],
290-
var.node_pools_tags[var.node_pools[count.index]["name"]]
285+
local.node_pools_tags["all"],
286+
local.node_pools_tags[var.node_pools[count.index]["name"]]
291287
)
292288
)
293289
)
@@ -314,7 +310,9 @@ resource "google_container_node_pool" "pools" {
314310
// use node_locations if provided, defaults to cluster level node_locations if not specified
315311
node_locations = lookup(var.node_pools[count.index], "node_locations", "") != "" ? split(",", var.node_pools[count.index]["node_locations"]) : null
316312
{% endif %}
317-
cluster = google_container_cluster.primary.name
313+
314+
cluster = google_container_cluster.primary.name
315+
318316
version = lookup(var.node_pools[count.index], "auto_upgrade", false) ? "" : lookup(
319317
var.node_pools[count.index],
320318
"version",
@@ -350,25 +348,25 @@ resource "google_container_node_pool" "pools" {
350348
image_type = lookup(var.node_pools[count.index], "image_type", "COS")
351349
machine_type = lookup(var.node_pools[count.index], "machine_type", "n1-standard-2")
352350
labels = merge(
353-
lookup(lookup(var.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
354-
lookup(lookup(var.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = var.node_pools[count.index]["name"] } : {},
355-
var.node_pools_labels["all"],
356-
var.node_pools_labels[var.node_pools[count.index]["name"]],
351+
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
352+
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = var.node_pools[count.index]["name"] } : {},
353+
local.node_pools_labels["all"],
354+
local.node_pools_labels[var.node_pools[count.index]["name"]],
357355
)
358356
metadata = merge(
359-
lookup(lookup(var.node_pools_metadata, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
360-
lookup(lookup(var.node_pools_metadata, "default_values", {}), "node_pool", true) ? { "node_pool" = var.node_pools[count.index]["name"] } : {},
361-
var.node_pools_metadata["all"],
362-
var.node_pools_metadata[var.node_pools[count.index]["name"]],
357+
lookup(lookup(local.node_pools_metadata, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
358+
lookup(lookup(local.node_pools_metadata, "default_values", {}), "node_pool", true) ? { "node_pool" = var.node_pools[count.index]["name"] } : {},
359+
local.node_pools_metadata["all"],
360+
local.node_pools_metadata[var.node_pools[count.index]["name"]],
363361
{
364362
"disable-legacy-endpoints" = var.disable_legacy_metadata_endpoints
365363
},
366364
)
367365
{% if beta_cluster %}
368366
dynamic "taint" {
369367
for_each = concat(
370-
var.node_pools_taints["all"],
371-
var.node_pools_taints[var.node_pools[count.index]["name"]],
368+
local.node_pools_taints["all"],
369+
local.node_pools_taints[var.node_pools[count.index]["name"]],
372370
)
373371
content {
374372
effect = taint.value.effect
@@ -378,14 +376,16 @@ resource "google_container_node_pool" "pools" {
378376
}
379377
{% endif %}
380378
tags = concat(
381-
lookup(var.node_pools_tags, "default_values", [true, true])[0] ? ["gke-${var.name}"] : [],
382-
lookup(var.node_pools_tags, "default_values", [true, true])[1] ? ["gke-${var.name}-${var.node_pools[count.index]["name"]}"] : [],
383-
var.node_pools_tags["all"],
384-
var.node_pools_tags[var.node_pools[count.index]["name"]],
379+
lookup(local.node_pools_tags, "default_values", [true, true])[0] ? ["gke-${var.name}"] : [],
380+
lookup(local.node_pools_tags, "default_values", [true, true])[1] ? ["gke-${var.name}-${var.node_pools[count.index]["name"]}"] : [],
381+
local.node_pools_tags["all"],
382+
local.node_pools_tags[var.node_pools[count.index]["name"]],
385383
)
386384

387-
disk_size_gb = lookup(var.node_pools[count.index], "disk_size_gb", 100)
388-
disk_type = lookup(var.node_pools[count.index], "disk_type", "pd-standard")
385+
local_ssd_count = lookup(var.node_pools[count.index], "local_ssd_count", 0)
386+
disk_size_gb = lookup(var.node_pools[count.index], "disk_size_gb", 100)
387+
disk_type = lookup(var.node_pools[count.index], "disk_type", "pd-standard")
388+
389389
service_account = lookup(
390390
var.node_pools[count.index],
391391
"service_account",
@@ -394,8 +394,8 @@ resource "google_container_node_pool" "pools" {
394394
preemptible = lookup(var.node_pools[count.index], "preemptible", false)
395395

396396
oauth_scopes = concat(
397-
var.node_pools_oauth_scopes["all"],
398-
var.node_pools_oauth_scopes[var.node_pools[count.index]["name"]],
397+
local.node_pools_oauth_scopes["all"],
398+
local.node_pools_oauth_scopes[var.node_pools[count.index]["name"]],
399399
)
400400

401401
guest_accelerator = [
@@ -429,6 +429,7 @@ resource "google_container_node_pool" "pools" {
429429

430430
lifecycle {
431431
ignore_changes = [initial_node_count]
432+
432433
{% if update_variant %}
433434
create_before_destroy = true
434435
{% endif %}
File renamed without changes.

autogen/main.tf renamed to autogen/main.tf.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ locals {
105105
cluster_output_network_policy_enabled = google_container_cluster.primary.addons_config.0.network_policy_config.0.disabled
106106
cluster_output_http_load_balancing_enabled = google_container_cluster.primary.addons_config.0.http_load_balancing.0.disabled
107107
cluster_output_horizontal_pod_autoscaling_enabled = google_container_cluster.primary.addons_config.0.horizontal_pod_autoscaling.0.disabled
108-
cluster_output_kubernetes_dashboard_enabled = google_container_cluster.primary.addons_config.0.kubernetes_dashboard.0.disabled
109108

110109
{% if beta_cluster %}
111110
# BETA features
@@ -139,15 +138,15 @@ locals {
139138
cluster_network_policy_enabled = ! local.cluster_output_network_policy_enabled
140139
cluster_http_load_balancing_enabled = ! local.cluster_output_http_load_balancing_enabled
141140
cluster_horizontal_pod_autoscaling_enabled = ! local.cluster_output_horizontal_pod_autoscaling_enabled
142-
cluster_kubernetes_dashboard_enabled = ! local.cluster_output_kubernetes_dashboard_enabled
143141
{% if beta_cluster %}
144142
# BETA features
145143
cluster_istio_enabled = ! local.cluster_output_istio_disabled
146144
cluster_cloudrun_enabled = var.cloudrun
147145
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
148146
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
149147
cluster_vertical_pod_autoscaling_enabled = local.cluster_output_vertical_pod_autoscaling_enabled
150-
cluster_workload_identity_config = var.identity_namespace == "" ? [] : [{
148+
149+
cluster_workload_identity_config = var.identity_namespace == "" ? [] : [{
151150
identity_namespace = var.identity_namespace
152151
}]
153152
# /BETA features
File renamed without changes.
File renamed without changes.

autogen/outputs.tf renamed to autogen/outputs.tf.tmpl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ output "endpoint" {
5454
*/
5555
google_container_cluster.primary,
5656
google_container_node_pool.pools,
57+
null_resource.wait_for_cluster.id,
5758
]
5859
}
5960

@@ -103,11 +104,6 @@ output "horizontal_pod_autoscaling_enabled" {
103104
value = local.cluster_horizontal_pod_autoscaling_enabled
104105
}
105106

106-
output "kubernetes_dashboard_enabled" {
107-
description = "Whether kubernetes dashboard enabled"
108-
value = local.cluster_kubernetes_dashboard_enabled
109-
}
110-
111107
output "node_pools_names" {
112108
description = "List of node pools names"
113109
value = local.cluster_node_pools_names
File renamed without changes.

0 commit comments

Comments
 (0)