Skip to content

Release Channels #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions autogen/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ resource "google_container_cluster" "primary" {
}
}

{% if beta_cluster %}
dynamic "release_channel" {
for_each = local.release_channel

content {
channel = release_channel.value.channel
}
}
{% endif %}

subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
min_master_version = local.master_version

Expand Down
4 changes: 4 additions & 0 deletions autogen/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ locals {
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
{% if beta_cluster %}
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
{% endif %}


custom_kube_dns_config = length(keys(var.stub_domains)) > 0
upstream_nameservers_config = length(var.upstream_nameservers) > 0
Expand Down
4 changes: 4 additions & 0 deletions autogen/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,8 @@ output "vertical_pod_autoscaling_enabled" {
value = local.cluster_vertical_pod_autoscaling_enabled
}

output "release_channel" {
description = "The release channel of this cluster"
value = var.release_channel
}
{% endif %}
5 changes: 5 additions & 0 deletions autogen/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,9 @@ variable "authenticator_security_group" {
default = null
}

variable "release_channel" {
type = string
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
default = null
}
{% endif %}
1 change: 1 addition & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ resource "google_container_cluster" "primary" {
}
}


subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
min_master_version = local.master_version

Expand Down
2 changes: 1 addition & 1 deletion examples/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.12.0"
version = "~> 2.18.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/node_pool_update_variant_beta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.12.0"
version = "~> 2.18.0"
credentials = file(var.credentials_path)
region = var.region
}
Expand Down
3 changes: 1 addition & 2 deletions examples/simple_regional_beta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.12.0"
version = "~> 2.18.0"
region = var.region
}

Expand All @@ -45,4 +45,3 @@ module "gke" {

data "google_client_config" "default" {
}

3 changes: 1 addition & 2 deletions examples/simple_regional_private_beta/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.12.0"
version = "~> 2.18.0"
credentials = file(var.credentials_path)
region = var.region
}
Expand Down Expand Up @@ -62,4 +62,3 @@ module "gke" {

data "google_client_config" "default" {
}

2 changes: 1 addition & 1 deletion examples/workload_metadata_config/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google-beta" {
version = "~> 2.12.0"
version = "~> 2.18.0"
region = var.region
}

Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ locals {
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
node_version = var.regional ? local.node_version_regional : local.node_version_zonal


custom_kube_dns_config = length(keys(var.stub_domains)) > 0
upstream_nameservers_config = length(var.upstream_nameservers) > 0
network_project_id = var.network_project_id != "" ? var.network_project_id : var.project_id
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
| 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 |
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"null"` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
| 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 |
| 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 |
Expand Down Expand Up @@ -225,6 +226,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| node\_pools\_versions | List of node pools versions |
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
| region | Cluster region |
| release\_channel | The release channel of this cluster |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| type | Cluster type (regional / zonal) |
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "release_channel" {
for_each = local.release_channel

content {
channel = release_channel.value.channel
}
}

subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
min_master_version = local.master_version

Expand Down
2 changes: 2 additions & 0 deletions modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ locals {
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []


custom_kube_dns_config = length(keys(var.stub_domains)) > 0
upstream_nameservers_config = length(var.upstream_nameservers) > 0
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ output "vertical_pod_autoscaling_enabled" {
value = local.cluster_vertical_pod_autoscaling_enabled
}

output "release_channel" {
description = "The release channel of this cluster"
value = var.release_channel
}
5 changes: 5 additions & 0 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,8 @@ variable "authenticator_security_group" {
default = null
}

variable "release_channel" {
type = string
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
default = null
}
2 changes: 2 additions & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
| 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 |
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"null"` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
| 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 |
| 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 |
Expand Down Expand Up @@ -225,6 +226,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| node\_pools\_versions | List of node pools versions |
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
| region | Cluster region |
| release\_channel | The release channel of this cluster |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| type | Cluster type (regional / zonal) |
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "release_channel" {
for_each = local.release_channel

content {
channel = release_channel.value.channel
}
}

subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
min_master_version = local.master_version

Expand Down
2 changes: 2 additions & 0 deletions modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ locals {
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []


custom_kube_dns_config = length(keys(var.stub_domains)) > 0
upstream_nameservers_config = length(var.upstream_nameservers) > 0
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ output "vertical_pod_autoscaling_enabled" {
value = local.cluster_vertical_pod_autoscaling_enabled
}

output "release_channel" {
description = "The release channel of this cluster"
value = var.release_channel
}
5 changes: 5 additions & 0 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,8 @@ variable "authenticator_security_group" {
default = null
}

variable "release_channel" {
type = string
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
default = null
}
2 changes: 2 additions & 0 deletions modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
| 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 |
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"null"` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
| 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 |
| 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 |
Expand Down Expand Up @@ -216,6 +217,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
| node\_pools\_versions | List of node pools versions |
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
| region | Cluster region |
| release\_channel | The release channel of this cluster |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| type | Cluster type (regional / zonal) |
| vertical\_pod\_autoscaling\_enabled | Whether veritical pod autoscaling is enabled |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "release_channel" {
for_each = local.release_channel

content {
channel = release_channel.value.channel
}
}

subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
min_master_version = local.master_version

Expand Down
2 changes: 2 additions & 0 deletions modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ locals {
node_version_zonal = var.node_version != "" && ! var.regional ? var.node_version : local.master_version_zonal
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
node_version = var.regional ? local.node_version_regional : local.node_version_zonal
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []


custom_kube_dns_config = length(keys(var.stub_domains)) > 0
upstream_nameservers_config = length(var.upstream_nameservers) > 0
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-public-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ output "vertical_pod_autoscaling_enabled" {
value = local.cluster_vertical_pod_autoscaling_enabled
}

output "release_channel" {
description = "The release channel of this cluster"
value = var.release_channel
}
5 changes: 5 additions & 0 deletions modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,8 @@ variable "authenticator_security_group" {
default = null
}

variable "release_channel" {
type = string
description = "(Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`."
default = null
}
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ resource "google_container_cluster" "primary" {
}
}


subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
min_master_version = local.master_version

Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ locals {
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
node_version = var.regional ? local.node_version_regional : local.node_version_zonal


custom_kube_dns_config = length(keys(var.stub_domains)) > 0
upstream_nameservers_config = length(var.upstream_nameservers) > 0
network_project_id = var.network_project_id != "" ? var.network_project_id : var.project_id
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ resource "google_container_cluster" "primary" {
}
}


subnetwork = data.google_compute_subnetwork.gke_subnetwork.self_link
min_master_version = local.master_version

Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ locals {
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
node_version = var.regional ? local.node_version_regional : local.node_version_zonal


custom_kube_dns_config = length(keys(var.stub_domains)) > 0
upstream_nameservers_config = length(var.upstream_nameservers) > 0
network_project_id = var.network_project_id != "" ? var.network_project_id : var.project_id
Expand Down
2 changes: 1 addition & 1 deletion scripts/wait-for-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2018 Google LLC
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module "gke-project" {
folder_id = var.folder_id
billing_account = var.billing_account

auto_create_network = true

activate_apis = [
"bigquery-json.googleapis.com",
"cloudkms.googleapis.com",
Expand Down
4 changes: 2 additions & 2 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ terraform {
}

provider "google" {
version = "~> 2.13.0"
version = "~> 2.18.0"
}

provider "google-beta" {
version = "~> 2.13.0"
version = "~> 2.18.0"
}