Skip to content

Commit

Permalink
feat: Add threads_per_core setting for node config in node pools (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvicsam committed May 22, 2024
1 parent 04ebd0c commit e573ced
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
7 changes: 7 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
14 changes: 14 additions & 0 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
14 changes: 14 additions & 0 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
14 changes: 14 additions & 0 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
14 changes: 14 additions & 0 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
14 changes: 14 additions & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
14 changes: 14 additions & 0 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e573ced

Please sign in to comment.