From 82f7515abbcf03a4dce87d0ec14a0e8a5e630450 Mon Sep 17 00:00:00 2001 From: Roberto Dedoro Date: Thu, 16 Jun 2022 08:52:44 +0800 Subject: [PATCH] promote Spot VM to GA --- .gitignore | 3 +++ README.md | 2 ++ autogen/main/README.md | 4 ++-- autogen/main/cluster.tf.tmpl | 4 ---- autogen/main/versions.tf.tmpl | 2 +- cluster.tf | 1 + modules/private-cluster-update-variant/README.md | 2 ++ modules/private-cluster-update-variant/cluster.tf | 2 ++ modules/private-cluster-update-variant/versions.tf | 2 +- modules/private-cluster/README.md | 2 ++ modules/private-cluster/cluster.tf | 1 + modules/private-cluster/versions.tf | 2 +- versions.tf | 2 +- 13 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 73d8076674..18ea9f457a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ Session.vim # IntelliJ IDEA files: .idea/ +# Visual Studio Code files: +.vscode/ + ### https://raw.github.com/github/gitignore/90f149de451a5433aebd94d02d11b0e28843a1af/Terraform.gitignore # Local .terraform directories diff --git a/README.md b/README.md index 0f338e2863..59f5a0ad33 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ module "gke" { min_count = 1 max_count = 100 local_ssd_count = 0 + spot = false disk_size_gb = 100 disk_type = "pd-standard" image_type = "COS_CONTAINERD" @@ -254,6 +255,7 @@ The node_pools variable takes the following parameters: | node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional | | node_metadata | Options to expose the node metadata to the workload running on the node | | Optional | | preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional | +| spot | A boolean that represents whether the underlying node VMs are spot | false | Optional | | service_account | The service account to be used by the Node VMs | " " | Optional | | tags | The list of instance tags applied to all nodes | | Required | | value | The value for the taint | | Required | diff --git a/autogen/main/README.md b/autogen/main/README.md index a41e0b6006..5169793c14 100644 --- a/autogen/main/README.md +++ b/autogen/main/README.md @@ -101,8 +101,8 @@ module "gke" { min_count = 1 max_count = 100 local_ssd_count = 0 - {% if beta_cluster %} spot = false + {% if beta_cluster %} local_ssd_ephemeral_count = 0 {% endif %} disk_size_gb = 100 @@ -223,8 +223,8 @@ The node_pools variable takes the following parameters: | node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional | | node_metadata | Options to expose the node metadata to the workload running on the node | | Optional | | preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional | -{% if beta_cluster %} | spot | A boolean that represents whether the underlying node VMs are spot | false | Optional | +{% if beta_cluster %} | sandbox_type | Sandbox to use for pods in the node pool | | Required | {% endif %} | service_account | The service account to be used by the Node VMs | " " | Optional | diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 92c42822e7..b4b38fdc5b 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -429,9 +429,7 @@ locals { "machine_type", "min_cpu_platform", "preemptible", - {% if beta_cluster %} "spot", - {% endif %} "service_account", "enable_gcfs", "enable_secure_boot", @@ -637,9 +635,7 @@ resource "google_container_node_pool" "pools" { local.service_account, ) preemptible = lookup(each.value, "preemptible", false) - {% if beta_cluster %} spot = lookup(each.value, "spot", false) - {% endif %} oauth_scopes = concat( local.node_pools_oauth_scopes["all"], diff --git a/autogen/main/versions.tf.tmpl b/autogen/main/versions.tf.tmpl index 861e63e1de..e58b063397 100644 --- a/autogen/main/versions.tf.tmpl +++ b/autogen/main/versions.tf.tmpl @@ -38,7 +38,7 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.10.0, < 5.0" + version = ">= 4.25.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/cluster.tf b/cluster.tf index 61518b6da6..e25ee3da31 100644 --- a/cluster.tf +++ b/cluster.tf @@ -344,6 +344,7 @@ resource "google_container_node_pool" "pools" { local.service_account, ) preemptible = lookup(each.value, "preemptible", false) + spot = lookup(each.value, "spot", false) oauth_scopes = concat( local.node_pools_oauth_scopes["all"], diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index c9e0c619b7..a70a4348b8 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -83,6 +83,7 @@ module "gke" { min_count = 1 max_count = 100 local_ssd_count = 0 + spot = false disk_size_gb = 100 disk_type = "pd-standard" image_type = "COS_CONTAINERD" @@ -288,6 +289,7 @@ The node_pools variable takes the following parameters: | node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional | | node_metadata | Options to expose the node metadata to the workload running on the node | | Optional | | preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional | +| spot | A boolean that represents whether the underlying node VMs are spot | false | Optional | | service_account | The service account to be used by the Node VMs | " " | Optional | | tags | The list of instance tags applied to all nodes | | Required | | value | The value for the taint | | Required | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 588a200b63..61121fee50 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -271,6 +271,7 @@ locals { "machine_type", "min_cpu_platform", "preemptible", + "spot", "service_account", "enable_gcfs", "enable_secure_boot", @@ -444,6 +445,7 @@ resource "google_container_node_pool" "pools" { local.service_account, ) preemptible = lookup(each.value, "preemptible", false) + spot = lookup(each.value, "spot", false) oauth_scopes = concat( local.node_pools_oauth_scopes["all"], diff --git a/modules/private-cluster-update-variant/versions.tf b/modules/private-cluster-update-variant/versions.tf index ea81af9ba9..07d5f9783f 100644 --- a/modules/private-cluster-update-variant/versions.tf +++ b/modules/private-cluster-update-variant/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.10.0, < 5.0" + version = ">= 4.25.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index 7d30994a2d..7840bfe82d 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -61,6 +61,7 @@ module "gke" { min_count = 1 max_count = 100 local_ssd_count = 0 + spot = false disk_size_gb = 100 disk_type = "pd-standard" image_type = "COS_CONTAINERD" @@ -266,6 +267,7 @@ The node_pools variable takes the following parameters: | node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional | | node_metadata | Options to expose the node metadata to the workload running on the node | | Optional | | preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional | +| spot | A boolean that represents whether the underlying node VMs are spot | false | Optional | | service_account | The service account to be used by the Node VMs | " " | Optional | | tags | The list of instance tags applied to all nodes | | Required | | value | The value for the taint | | Required | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 6a222bc9bf..fcd90b03d8 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -357,6 +357,7 @@ resource "google_container_node_pool" "pools" { local.service_account, ) preemptible = lookup(each.value, "preemptible", false) + spot = lookup(each.value, "spot", false) oauth_scopes = concat( local.node_pools_oauth_scopes["all"], diff --git a/modules/private-cluster/versions.tf b/modules/private-cluster/versions.tf index 5ee9f41bc5..0115ae81ad 100644 --- a/modules/private-cluster/versions.tf +++ b/modules/private-cluster/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.10.0, < 5.0" + version = ">= 4.25.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/versions.tf b/versions.tf index 09132e746d..878b7bc8ff 100644 --- a/versions.tf +++ b/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.10.0, < 5.0" + version = ">= 4.25.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes"