diff --git a/README.md b/README.md index d11869a0a..2212da811 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ Then perform the following commands on the root folder: | node\_metadata | Specifies how node metadata is exposed to the workload running on the node | `string` | `"GKE_METADATA"` | no | | node\_pools | List of maps containing node pools | `list(map(any))` |
[| no | | node\_pools\_labels | Map of maps containing node labels by node-pool name | `map(map(string))` |
{
"name": "default-node-pool"
}
]
{| no | +| node\_pools\_linux\_node\_configs\_sysctls | Map of maps containing linux node config sysctls by node-pool name | `map(map(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_metadata | Map of maps containing node metadata by node-pool name | `map(map(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | `map(list(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_resource\_labels | Map of maps containing resource labels by node-pool name | `map(map(string))` |
"all": [
"https://www.googleapis.com/auth/cloud-platform"
],
"default-node-pool": []
}
{| no | @@ -310,7 +311,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP][terraform-provider-google] v4.47 +- [Terraform Provider for GCP][terraform-provider-google] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/autogen/main/README.md b/autogen/main/README.md index 4f1a2933c..40182f7c3 100644 --- a/autogen/main/README.md +++ b/autogen/main/README.md @@ -256,9 +256,9 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ {% if beta_cluster %} -- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.47 +- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51 {% else %} -- [Terraform Provider for GCP][terraform-provider-google] v4.47 +- [Terraform Provider for GCP][terraform-provider-google] v4.51 {% endif %} #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 375ebe91c..be8444160 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -803,6 +803,7 @@ resource "google_container_node_pool" "windows_pools" { cpu_cfs_quota_period = lookup(each.value, "cpu_cfs_quota_period", null) } } + {% endif %} {% if i == 0 %} dynamic "linux_node_config" { @@ -819,7 +820,6 @@ resource "google_container_node_pool" "windows_pools" { } } {% endif %} - {% endif %} boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "") diff --git a/autogen/main/variables.tf.tmpl b/autogen/main/variables.tf.tmpl index d82622ea3..188f90c35 100644 --- a/autogen/main/variables.tf.tmpl +++ b/autogen/main/variables.tf.tmpl @@ -191,7 +191,6 @@ variable "node_pools_metadata" { default-node-pool = {} } } -{% if beta_cluster %} variable "node_pools_linux_node_configs_sysctls" { type = map(map(string)) @@ -204,7 +203,6 @@ variable "node_pools_linux_node_configs_sysctls" { } } {% endif %} -{% endif %} variable "enable_cost_allocation" { type = bool diff --git a/autogen/main/variables_defaults.tf.tmpl b/autogen/main/variables_defaults.tf.tmpl index d98c96287..3aa635a36 100644 --- a/autogen/main/variables_defaults.tf.tmpl +++ b/autogen/main/variables_defaults.tf.tmpl @@ -104,7 +104,6 @@ locals { ), var.node_pools_oauth_scopes ) - {% if beta_cluster %} node_pools_linux_node_configs_sysctls = merge( { all = {} }, @@ -115,6 +114,5 @@ locals { ), var.node_pools_linux_node_configs_sysctls ) - {% endif %} } {% endif %} diff --git a/autogen/main/versions.tf.tmpl b/autogen/main/versions.tf.tmpl index 50f1c956b..e87bb3609 100644 --- a/autogen/main/versions.tf.tmpl +++ b/autogen/main/versions.tf.tmpl @@ -24,7 +24,7 @@ terraform { required_providers { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" @@ -38,7 +38,7 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/cluster.tf b/cluster.tf index e210c766f..49520613e 100644 --- a/cluster.tf +++ b/cluster.tf @@ -499,6 +499,20 @@ resource "google_container_node_pool" "pools" { } + dynamic "linux_node_config" { + for_each = length(merge( + local.node_pools_linux_node_configs_sysctls["all"], + local.node_pools_linux_node_configs_sysctls[each.value["name"]] + )) != 0 ? [1] : [] + + content { + sysctls = merge( + local.node_pools_linux_node_configs_sysctls["all"], + local.node_pools_linux_node_configs_sysctls[each.value["name"]] + ) + } + } + boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "") shielded_instance_config { @@ -657,6 +671,7 @@ resource "google_container_node_pool" "windows_pools" { } + boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "") shielded_instance_config { diff --git a/modules/beta-autopilot-private-cluster/README.md b/modules/beta-autopilot-private-cluster/README.md index d88ac08f8..db7068e0f 100644 --- a/modules/beta-autopilot-private-cluster/README.md +++ b/modules/beta-autopilot-private-cluster/README.md @@ -187,7 +187,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.47 +- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/beta-autopilot-private-cluster/versions.tf b/modules/beta-autopilot-private-cluster/versions.tf index 0e367f034..8e85a539a 100644 --- a/modules/beta-autopilot-private-cluster/versions.tf +++ b/modules/beta-autopilot-private-cluster/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/beta-autopilot-public-cluster/README.md b/modules/beta-autopilot-public-cluster/README.md index 0ff3b19d6..265743bfc 100644 --- a/modules/beta-autopilot-public-cluster/README.md +++ b/modules/beta-autopilot-public-cluster/README.md @@ -174,7 +174,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.47 +- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/beta-autopilot-public-cluster/versions.tf b/modules/beta-autopilot-public-cluster/versions.tf index 6df195547..27d45f004 100644 --- a/modules/beta-autopilot-public-cluster/versions.tf +++ b/modules/beta-autopilot-public-cluster/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/beta-private-cluster-update-variant/README.md b/modules/beta-private-cluster-update-variant/README.md index 872ceaae0..d084f718f 100644 --- a/modules/beta-private-cluster-update-variant/README.md +++ b/modules/beta-private-cluster-update-variant/README.md @@ -379,7 +379,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.47 +- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/beta-private-cluster-update-variant/versions.tf b/modules/beta-private-cluster-update-variant/versions.tf index d578a8020..051c5776b 100644 --- a/modules/beta-private-cluster-update-variant/versions.tf +++ b/modules/beta-private-cluster-update-variant/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/beta-private-cluster/README.md b/modules/beta-private-cluster/README.md index 7668f6ea0..dde80c462 100644 --- a/modules/beta-private-cluster/README.md +++ b/modules/beta-private-cluster/README.md @@ -357,7 +357,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.47 +- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/beta-private-cluster/versions.tf b/modules/beta-private-cluster/versions.tf index 2fc9d7c76..fbe6e9b03 100644 --- a/modules/beta-private-cluster/versions.tf +++ b/modules/beta-private-cluster/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/beta-public-cluster-update-variant/README.md b/modules/beta-public-cluster-update-variant/README.md index 08dc370eb..b366957d8 100644 --- a/modules/beta-public-cluster-update-variant/README.md +++ b/modules/beta-public-cluster-update-variant/README.md @@ -366,7 +366,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.47 +- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/beta-public-cluster-update-variant/versions.tf b/modules/beta-public-cluster-update-variant/versions.tf index a4d5064d5..54d0f76dc 100644 --- a/modules/beta-public-cluster-update-variant/versions.tf +++ b/modules/beta-public-cluster-update-variant/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/beta-public-cluster/README.md b/modules/beta-public-cluster/README.md index 8988a490b..c018d01fd 100644 --- a/modules/beta-public-cluster/README.md +++ b/modules/beta-public-cluster/README.md @@ -344,7 +344,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.47 +- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/beta-public-cluster/versions.tf b/modules/beta-public-cluster/versions.tf index 413ce1cf0..f3baf3a8a 100644 --- a/modules/beta-public-cluster/versions.tf +++ b/modules/beta-public-cluster/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google-beta = { source = "hashicorp/google-beta" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index ea7035c14..8d952ab9c 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -221,6 +221,7 @@ Then perform the following commands on the root folder: | node\_metadata | Specifies how node metadata is exposed to the workload running on the node | `string` | `"GKE_METADATA"` | no | | node\_pools | List of maps containing node pools | `list(map(any))` |
"all": {},
"default-node-pool": {}
}
[| no | | node\_pools\_labels | Map of maps containing node labels by node-pool name | `map(map(string))` |
{
"name": "default-node-pool"
}
]
{| no | +| node\_pools\_linux\_node\_configs\_sysctls | Map of maps containing linux node config sysctls by node-pool name | `map(map(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_metadata | Map of maps containing node metadata by node-pool name | `map(map(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | `map(list(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_resource\_labels | Map of maps containing resource labels by node-pool name | `map(map(string))` |
"all": [
"https://www.googleapis.com/auth/cloud-platform"
],
"default-node-pool": []
}
{| no | @@ -345,7 +346,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP][terraform-provider-google] v4.47 +- [Terraform Provider for GCP][terraform-provider-google] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 7296de0bd..eafefad05 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -612,6 +612,20 @@ resource "google_container_node_pool" "pools" { } + dynamic "linux_node_config" { + for_each = length(merge( + local.node_pools_linux_node_configs_sysctls["all"], + local.node_pools_linux_node_configs_sysctls[each.value["name"]] + )) != 0 ? [1] : [] + + content { + sysctls = merge( + local.node_pools_linux_node_configs_sysctls["all"], + local.node_pools_linux_node_configs_sysctls[each.value["name"]] + ) + } + } + boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "") shielded_instance_config { @@ -771,6 +785,7 @@ resource "google_container_node_pool" "windows_pools" { } + boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "") shielded_instance_config { diff --git a/modules/private-cluster-update-variant/variables.tf b/modules/private-cluster-update-variant/variables.tf index 240e128df..ae9369058 100644 --- a/modules/private-cluster-update-variant/variables.tf +++ b/modules/private-cluster-update-variant/variables.tf @@ -191,6 +191,17 @@ variable "node_pools_metadata" { } } +variable "node_pools_linux_node_configs_sysctls" { + type = map(map(string)) + description = "Map of maps containing linux node config sysctls by node-pool name" + + # Default is being set in variables_defaults.tf + default = { + all = {} + default-node-pool = {} + } +} + variable "enable_cost_allocation" { type = bool description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery" diff --git a/modules/private-cluster-update-variant/variables_defaults.tf b/modules/private-cluster-update-variant/variables_defaults.tf index 39a311980..e4f300477 100644 --- a/modules/private-cluster-update-variant/variables_defaults.tf +++ b/modules/private-cluster-update-variant/variables_defaults.tf @@ -103,4 +103,14 @@ locals { ), var.node_pools_oauth_scopes ) + + node_pools_linux_node_configs_sysctls = merge( + { all = {} }, + { default-node-pool = {} }, + zipmap( + [for node_pool in var.node_pools : node_pool["name"]], + [for node_pool in var.node_pools : {}] + ), + var.node_pools_linux_node_configs_sysctls + ) } diff --git a/modules/private-cluster-update-variant/versions.tf b/modules/private-cluster-update-variant/versions.tf index 8fba8fefb..f0829f30b 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.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index ba944d0e1..e82ae76c2 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -199,6 +199,7 @@ Then perform the following commands on the root folder: | node\_metadata | Specifies how node metadata is exposed to the workload running on the node | `string` | `"GKE_METADATA"` | no | | node\_pools | List of maps containing node pools | `list(map(any))` |
"all": {},
"default-node-pool": {}
}
[| no | | node\_pools\_labels | Map of maps containing node labels by node-pool name | `map(map(string))` |
{
"name": "default-node-pool"
}
]
{| no | +| node\_pools\_linux\_node\_configs\_sysctls | Map of maps containing linux node config sysctls by node-pool name | `map(map(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_metadata | Map of maps containing node metadata by node-pool name | `map(map(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | `map(list(string))` |
"all": {},
"default-node-pool": {}
}
{| no | | node\_pools\_resource\_labels | Map of maps containing resource labels by node-pool name | `map(map(string))` |
"all": [
"https://www.googleapis.com/auth/cloud-platform"
],
"default-node-pool": []
}
{| no | @@ -323,7 +324,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog - [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x #### Terraform and Plugins - [Terraform](https://www.terraform.io/downloads.html) 0.13+ -- [Terraform Provider for GCP][terraform-provider-google] v4.47 +- [Terraform Provider for GCP][terraform-provider-google] v4.51 #### gcloud Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH. See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information. diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 6db88ac3a..9711d27d9 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -518,6 +518,20 @@ resource "google_container_node_pool" "pools" { } + dynamic "linux_node_config" { + for_each = length(merge( + local.node_pools_linux_node_configs_sysctls["all"], + local.node_pools_linux_node_configs_sysctls[each.value["name"]] + )) != 0 ? [1] : [] + + content { + sysctls = merge( + local.node_pools_linux_node_configs_sysctls["all"], + local.node_pools_linux_node_configs_sysctls[each.value["name"]] + ) + } + } + boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "") shielded_instance_config { @@ -676,6 +690,7 @@ resource "google_container_node_pool" "windows_pools" { } + boot_disk_kms_key = lookup(each.value, "boot_disk_kms_key", "") shielded_instance_config { diff --git a/modules/private-cluster/variables.tf b/modules/private-cluster/variables.tf index 240e128df..ae9369058 100644 --- a/modules/private-cluster/variables.tf +++ b/modules/private-cluster/variables.tf @@ -191,6 +191,17 @@ variable "node_pools_metadata" { } } +variable "node_pools_linux_node_configs_sysctls" { + type = map(map(string)) + description = "Map of maps containing linux node config sysctls by node-pool name" + + # Default is being set in variables_defaults.tf + default = { + all = {} + default-node-pool = {} + } +} + variable "enable_cost_allocation" { type = bool description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery" diff --git a/modules/private-cluster/variables_defaults.tf b/modules/private-cluster/variables_defaults.tf index 39a311980..e4f300477 100644 --- a/modules/private-cluster/variables_defaults.tf +++ b/modules/private-cluster/variables_defaults.tf @@ -103,4 +103,14 @@ locals { ), var.node_pools_oauth_scopes ) + + node_pools_linux_node_configs_sysctls = merge( + { all = {} }, + { default-node-pool = {} }, + zipmap( + [for node_pool in var.node_pools : node_pool["name"]], + [for node_pool in var.node_pools : {}] + ), + var.node_pools_linux_node_configs_sysctls + ) } diff --git a/modules/private-cluster/versions.tf b/modules/private-cluster/versions.tf index 5d0dbd548..3f11c91dc 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.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes" diff --git a/test/fixtures/safer_cluster_iap_bastion/version.tf b/test/fixtures/safer_cluster_iap_bastion/version.tf index 4262d872b..46c8c86f1 100644 --- a/test/fixtures/safer_cluster_iap_bastion/version.tf +++ b/test/fixtures/safer_cluster_iap_bastion/version.tf @@ -18,9 +18,8 @@ terraform { required_version = ">= 0.13.0" required_providers { google = { - source = "hashicorp/google" - # Avoid v4.49.0 for https://github.com/hashicorp/terraform-provider-google/issues/13507 - version = "!= 4.49.0, != 4.50.0" + source = "hashicorp/google" + version = ">= 4.51.0" } } } diff --git a/variables.tf b/variables.tf index 2efed7a22..764abfdb1 100644 --- a/variables.tf +++ b/variables.tf @@ -191,6 +191,17 @@ variable "node_pools_metadata" { } } +variable "node_pools_linux_node_configs_sysctls" { + type = map(map(string)) + description = "Map of maps containing linux node config sysctls by node-pool name" + + # Default is being set in variables_defaults.tf + default = { + all = {} + default-node-pool = {} + } +} + variable "enable_cost_allocation" { type = bool description = "Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery" diff --git a/variables_defaults.tf b/variables_defaults.tf index 39a311980..e4f300477 100644 --- a/variables_defaults.tf +++ b/variables_defaults.tf @@ -103,4 +103,14 @@ locals { ), var.node_pools_oauth_scopes ) + + node_pools_linux_node_configs_sysctls = merge( + { all = {} }, + { default-node-pool = {} }, + zipmap( + [for node_pool in var.node_pools : node_pool["name"]], + [for node_pool in var.node_pools : {}] + ), + var.node_pools_linux_node_configs_sysctls + ) } diff --git a/versions.tf b/versions.tf index 6d0841514..ec5f944ad 100644 --- a/versions.tf +++ b/versions.tf @@ -21,7 +21,7 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.47.0, < 5.0" + version = ">= 4.51.0, < 5.0" } kubernetes = { source = "hashicorp/kubernetes"
"all": {},
"default-node-pool": {}
}