Skip to content

Commit 8116389

Browse files
authored
Merge pull request #283 from chrissng/release-channels
Release Channels
2 parents 287eaa4 + 42a0376 commit 8116389

File tree

33 files changed

+102
-10
lines changed

33 files changed

+102
-10
lines changed

autogen/cluster.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ resource "google_container_cluster" "primary" {
4545
}
4646
}
4747

48+
{% if beta_cluster %}
49+
dynamic "release_channel" {
50+
for_each = local.release_channel
51+
52+
content {
53+
channel = release_channel.value.channel
54+
}
55+
}
56+
{% endif %}
57+
4858
subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
4959
min_master_version = local.master_version
5060

autogen/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ locals {
4848
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
4949
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
5050
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
51+
{% if beta_cluster %}
52+
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
53+
{% endif %}
54+
5155

5256
custom_kube_dns_config = length(keys(var.stub_domains)) > 0
5357
upstream_nameservers_config = length(var.upstream_nameservers) > 0

autogen/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,8 @@ output "vertical_pod_autoscaling_enabled" {
150150
value = local.cluster_vertical_pod_autoscaling_enabled
151151
}
152152

153+
output "release_channel" {
154+
description = "The release channel of this cluster"
155+
value = var.release_channel
156+
}
153157
{% endif %}

autogen/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,9 @@ variable "authenticator_security_group" {
422422
default = null
423423
}
424424

425+
variable "release_channel" {
426+
type = string
427+
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
428+
default = null
429+
}
425430
{% endif %}

cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ resource "google_container_cluster" "primary" {
4141
}
4242
}
4343

44+
4445
subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
4546
min_master_version = local.master_version
4647

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 2.12.0"
22+
version = "~> 2.18.0"
2323
region = var.region
2424
}
2525

examples/node_pool_update_variant_beta/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 2.12.0"
22+
version = "~> 2.18.0"
2323
credentials = file(var.credentials_path)
2424
region = var.region
2525
}

examples/simple_regional_beta/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 2.12.0"
22+
version = "~> 2.18.0"
2323
region = var.region
2424
}
2525

@@ -45,4 +45,3 @@ module "gke" {
4545

4646
data "google_client_config" "default" {
4747
}
48-

examples/simple_regional_private_beta/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 2.12.0"
22+
version = "~> 2.18.0"
2323
credentials = file(var.credentials_path)
2424
region = var.region
2525
}
@@ -62,4 +62,3 @@ module "gke" {
6262

6363
data "google_client_config" "default" {
6464
}
65-

examples/workload_metadata_config/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 2.12.0"
22+
version = "~> 2.18.0"
2323
region = var.region
2424
}
2525

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ locals {
4545
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
4646
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
4747

48+
4849
custom_kube_dns_config = length(keys(var.stub_domains)) > 0
4950
upstream_nameservers_config = length(var.upstream_nameservers) > 0
5051
network_project_id = var.network_project_id != "" ? var.network_project_id : var.project_id

modules/beta-private-cluster-update-variant/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
191191
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
192192
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
193193
| registry\_project\_id | Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project. | string | `""` | no |
194+
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"null"` | no |
194195
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
195196
| resource\_usage\_export\_dataset\_id | The dataset id for which network egress metering for this cluster will be enabled. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | string | `""` | no |
196197
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` and `node_version` = `1.12.7-gke.17` or later to use it). | bool | `"false"` | no |
@@ -225,6 +226,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
225226
| node\_pools\_versions | List of node pools versions |
226227
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
227228
| region | Cluster region |
229+
| release\_channel | The release channel of this cluster |
228230
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
229231
| type | Cluster type (regional / zonal) |
230232
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ resource "google_container_cluster" "primary" {
4141
}
4242
}
4343

44+
dynamic "release_channel" {
45+
for_each = local.release_channel
46+
47+
content {
48+
channel = release_channel.value.channel
49+
}
50+
}
51+
4452
subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
4553
min_master_version = local.master_version
4654

modules/beta-private-cluster-update-variant/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ locals {
4444
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
4545
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
4646
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
47+
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
48+
4749

4850
custom_kube_dns_config = length(keys(var.stub_domains)) > 0
4951
upstream_nameservers_config = length(var.upstream_nameservers) > 0

modules/beta-private-cluster-update-variant/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,7 @@ output "vertical_pod_autoscaling_enabled" {
149149
value = local.cluster_vertical_pod_autoscaling_enabled
150150
}
151151

152+
output "release_channel" {
153+
description = "The release channel of this cluster"
154+
value = var.release_channel
155+
}

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,8 @@ variable "authenticator_security_group" {
417417
default = null
418418
}
419419

420+
variable "release_channel" {
421+
type = string
422+
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
423+
default = null
424+
}

modules/beta-private-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
191191
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
192192
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
193193
| registry\_project\_id | Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project. | string | `""` | no |
194+
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"null"` | no |
194195
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
195196
| resource\_usage\_export\_dataset\_id | The dataset id for which network egress metering for this cluster will be enabled. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | string | `""` | no |
196197
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` and `node_version` = `1.12.7-gke.17` or later to use it). | bool | `"false"` | no |
@@ -225,6 +226,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
225226
| node\_pools\_versions | List of node pools versions |
226227
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
227228
| region | Cluster region |
229+
| release\_channel | The release channel of this cluster |
228230
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
229231
| type | Cluster type (regional / zonal) |
230232
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |

modules/beta-private-cluster/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ resource "google_container_cluster" "primary" {
4141
}
4242
}
4343

44+
dynamic "release_channel" {
45+
for_each = local.release_channel
46+
47+
content {
48+
channel = release_channel.value.channel
49+
}
50+
}
51+
4452
subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
4553
min_master_version = local.master_version
4654

modules/beta-private-cluster/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ locals {
4444
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
4545
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
4646
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
47+
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
48+
4749

4850
custom_kube_dns_config = length(keys(var.stub_domains)) > 0
4951
upstream_nameservers_config = length(var.upstream_nameservers) > 0

modules/beta-private-cluster/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,7 @@ output "vertical_pod_autoscaling_enabled" {
149149
value = local.cluster_vertical_pod_autoscaling_enabled
150150
}
151151

152+
output "release_channel" {
153+
description = "The release channel of this cluster"
154+
value = var.release_channel
155+
}

modules/beta-private-cluster/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,8 @@ variable "authenticator_security_group" {
417417
default = null
418418
}
419419

420+
variable "release_channel" {
421+
type = string
422+
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
423+
default = null
424+
}

modules/beta-public-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
182182
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
183183
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
184184
| registry\_project\_id | Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project. | string | `""` | no |
185+
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"null"` | no |
185186
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
186187
| resource\_usage\_export\_dataset\_id | The dataset id for which network egress metering for this cluster will be enabled. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | string | `""` | no |
187188
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` and `node_version` = `1.12.7-gke.17` or later to use it). | bool | `"false"` | no |
@@ -216,6 +217,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
216217
| node\_pools\_versions | List of node pools versions |
217218
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
218219
| region | Cluster region |
220+
| release\_channel | The release channel of this cluster |
219221
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
220222
| type | Cluster type (regional / zonal) |
221223
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |

modules/beta-public-cluster/cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ resource "google_container_cluster" "primary" {
4141
}
4242
}
4343

44+
dynamic "release_channel" {
45+
for_each = local.release_channel
46+
47+
content {
48+
channel = release_channel.value.channel
49+
}
50+
}
51+
4452
subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
4553
min_master_version = local.master_version
4654

modules/beta-public-cluster/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ locals {
4444
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
4545
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
4646
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
47+
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
48+
4749

4850
custom_kube_dns_config = length(keys(var.stub_domains)) > 0
4951
upstream_nameservers_config = length(var.upstream_nameservers) > 0

modules/beta-public-cluster/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,7 @@ output "vertical_pod_autoscaling_enabled" {
149149
value = local.cluster_vertical_pod_autoscaling_enabled
150150
}
151151

152+
output "release_channel" {
153+
description = "The release channel of this cluster"
154+
value = var.release_channel
155+
}

modules/beta-public-cluster/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,3 +393,8 @@ variable "authenticator_security_group" {
393393
default = null
394394
}
395395

396+
variable "release_channel" {
397+
type = string
398+
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
399+
default = null
400+
}

modules/private-cluster-update-variant/cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ resource "google_container_cluster" "primary" {
4141
}
4242
}
4343

44+
4445
subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
4546
min_master_version = local.master_version
4647

modules/private-cluster-update-variant/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ locals {
4545
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
4646
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
4747

48+
4849
custom_kube_dns_config = length(keys(var.stub_domains)) > 0
4950
upstream_nameservers_config = length(var.upstream_nameservers) > 0
5051
network_project_id = var.network_project_id != "" ? var.network_project_id : var.project_id

modules/private-cluster/cluster.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ resource "google_container_cluster" "primary" {
4141
}
4242
}
4343

44+
4445
subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
4546
min_master_version = local.master_version
4647

modules/private-cluster/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ locals {
4545
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
4646
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
4747

48+
4849
custom_kube_dns_config = length(keys(var.stub_domains)) > 0
4950
upstream_nameservers_config = length(var.upstream_nameservers) > 0
5051
network_project_id = var.network_project_id != "" ? var.network_project_id : var.project_id

scripts/wait-for-cluster.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2018 Google LLC
2+
# Copyright 2019 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

test/setup/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module "gke-project" {
2424
folder_id = var.folder_id
2525
billing_account = var.billing_account
2626

27+
auto_create_network = true
28+
2729
activate_apis = [
2830
"bigquery-json.googleapis.com",
2931
"cloudkms.googleapis.com",

test/setup/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ terraform {
1919
}
2020

2121
provider "google" {
22-
version = "~> 2.13.0"
22+
version = "~> 2.18.0"
2323
}
2424

2525
provider "google-beta" {
26-
version = "~> 2.13.0"
26+
version = "~> 2.18.0"
2727
}

0 commit comments

Comments
 (0)