diff --git a/README.md b/README.md index 9296f278c0..c354cd843f 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/autogen/main/README.md b/autogen/main/README.md index 49827285e4..5801d04b4c 100644 --- a/autogen/main/README.md +++ b/autogen/main/README.md @@ -223,6 +223,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 96356c808a..49a2508cc3 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -930,6 +930,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config diff --git a/cluster.tf b/cluster.tf index d4c17bcecf..32f9f29d78 100644 --- a/cluster.tf +++ b/cluster.tf @@ -647,6 +647,13 @@ resource "google_container_node_pool" "pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -878,6 +885,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config diff --git a/modules/beta-private-cluster-update-variant/README.md b/modules/beta-private-cluster-update-variant/README.md index aa24ab95c8..883af3419e 100644 --- a/modules/beta-private-cluster-update-variant/README.md +++ b/modules/beta-private-cluster-update-variant/README.md @@ -371,6 +371,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index fdb6f891d8..9a0b421085 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -814,6 +814,13 @@ resource "google_container_node_pool" "pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -1071,6 +1078,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config diff --git a/modules/beta-private-cluster/README.md b/modules/beta-private-cluster/README.md index 91b95efbb3..0f06cabef4 100644 --- a/modules/beta-private-cluster/README.md +++ b/modules/beta-private-cluster/README.md @@ -349,6 +349,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 742ecaef32..135659eb57 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -738,6 +738,13 @@ resource "google_container_node_pool" "pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -994,6 +1001,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config diff --git a/modules/beta-public-cluster-update-variant/README.md b/modules/beta-public-cluster-update-variant/README.md index 9ccec076a4..12dacc2128 100644 --- a/modules/beta-public-cluster-update-variant/README.md +++ b/modules/beta-public-cluster-update-variant/README.md @@ -358,6 +358,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index 2d0f4ff8e7..9f2e50b48d 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -795,6 +795,13 @@ resource "google_container_node_pool" "pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -1052,6 +1059,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config diff --git a/modules/beta-public-cluster/README.md b/modules/beta-public-cluster/README.md index 9f8037a19f..5a5ce13dea 100644 --- a/modules/beta-public-cluster/README.md +++ b/modules/beta-public-cluster/README.md @@ -336,6 +336,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index fcbac0cac4..12db7772e0 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -719,6 +719,13 @@ resource "google_container_node_pool" "pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -975,6 +982,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index 267ab2b50e..b20d8da1af 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -343,6 +343,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index d48a810a0c..2dcbfe095e 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -742,6 +742,13 @@ resource "google_container_node_pool" "pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -974,6 +981,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index dc1559b943..9d77ba0c24 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -321,6 +321,7 @@ The node_pools variable takes the following parameters: | total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional | | max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional | | strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional | +| threads_per_core | Optional The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed | null | Optional | | max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. Only works with `SURGE` strategy. | 1 | Optional | | max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. Only works with `SURGE` strategy. | 0 | Optional | | node_pool_soak_duration | Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up. By default, it is set to one hour (3600 seconds). The maximum length of the soak time is 7 days (604,800 seconds). Only works with `BLUE_GREEN` strategy. | "3600s" | Optional | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 335415508f..34f56ffacf 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -666,6 +666,13 @@ resource "google_container_node_pool" "pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config @@ -897,6 +904,13 @@ resource "google_container_node_pool" "windows_pools" { } } + dynamic "advanced_machine_features" { + for_each = lookup(each.value, "threads_per_core", 0) > 0 ? [1] : [] + content { + threads_per_core = lookup(each.value, "threads_per_core", 0) + } + } + dynamic "workload_metadata_config" { for_each = local.cluster_node_metadata_config