From 274da2fd594684d2400d29ceff96342be01aebf1 Mon Sep 17 00:00:00 2001 From: Roberto Dedoro <34625241+mirobertod@users.noreply.github.com> Date: Thu, 30 Jun 2022 01:51:41 +0200 Subject: [PATCH] feat!: promote Spot VM to GA (#1294) promote Spot VM to GA Co-authored-by: Bharath KKB --- .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 73d807667..18ea9f457 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 b1f8247a3..0911237b2 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 a41e0b600..5169793c1 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 7892e9b0f..49e9c5ac6 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -444,9 +444,7 @@ locals { "machine_type", "min_cpu_platform", "preemptible", - {% if beta_cluster %} "spot", - {% endif %} "service_account", "enable_gcfs", "enable_secure_boot", @@ -652,9 +650,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 47767df66..205404f54 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 3cd0f6f83..8565e41a9 100644 --- a/cluster.tf +++ b/cluster.tf @@ -351,6 +351,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 a3b0a135e..9add63fa0 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 1a4cdf5eb..6e65239e1 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -278,6 +278,7 @@ locals { "machine_type", "min_cpu_platform", "preemptible", + "spot", "service_account", "enable_gcfs", "enable_secure_boot", @@ -451,6 +452,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 6af987847..1fc9b2604 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 3ded26b96..286d9a0b0 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 7b74bf149..91e16f98e 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -364,6 +364,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 f90170535..9c3992fd8 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 970e0413f..8d33ebe1a 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"