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 b1f8247a36..0911237b24 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 7892e9b0f7..49e9c5ac66 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 47767df66b..205404f542 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 3cd0f6f835..8565e41a9e 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 a3b0a135e8..9add63fa06 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 1a4cdf5ebc..6e65239e11 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 6af987847e..1fc9b2604b 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 3ded26b96e..286d9a0b09 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 7b74bf1493..91e16f98e3 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 f901705353..9c3992fd88 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 970e0413f3..8d33ebe1af 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"