diff --git a/README.md b/README.md index 522564c06e..d5ebebeaf5 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,9 @@ The node_pools variable takes the following parameters: | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | | min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional | | max_count | Maximum number of nodes in the NodePool. Must be >= min_count | 100 | Optional | +| max_pods_per_node | The maximum number of pods per node in this cluster | 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. | 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. | 0 | Optional | | min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional | | name | The name of the node pool | | Required | | node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusers | | Required | diff --git a/autogen/main/README.md b/autogen/main/README.md index 6fde2af604..e2e2eb48c1 100644 --- a/autogen/main/README.md +++ b/autogen/main/README.md @@ -211,11 +211,9 @@ The node_pools variable takes the following parameters: | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | | min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional | | max_count | Maximum number of nodes in the NodePool. Must be >= min_count | 100 | Optional | -{% if beta_cluster %} | max_pods_per_node | The maximum number of pods per node in this cluster | 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. | 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. | 0 | Optional | -{% endif %} | min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional | | name | The name of the node pool | | Required | {% if beta_cluster %} diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 22b16b9845..42e5e551a1 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -610,12 +610,10 @@ resource "google_container_node_pool" "pools" { auto_upgrade = lookup(each.value, "auto_upgrade", local.default_auto_upgrade) } - {% if beta_cluster %} upgrade_settings { max_surge = lookup(each.value, "max_surge", 1) max_unavailable = lookup(each.value, "max_unavailable", 0) } - {% endif %} node_config { image_type = lookup(each.value, "image_type", "COS_CONTAINERD") diff --git a/cluster.tf b/cluster.tf index 6de632f8a9..9ba51ad550 100644 --- a/cluster.tf +++ b/cluster.tf @@ -303,6 +303,10 @@ resource "google_container_node_pool" "pools" { auto_upgrade = lookup(each.value, "auto_upgrade", local.default_auto_upgrade) } + upgrade_settings { + max_surge = lookup(each.value, "max_surge", 1) + max_unavailable = lookup(each.value, "max_unavailable", 0) + } node_config { image_type = lookup(each.value, "image_type", "COS_CONTAINERD") diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index cdc59dbd55..7f5c136d56 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -285,6 +285,9 @@ The node_pools variable takes the following parameters: | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | | min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional | | max_count | Maximum number of nodes in the NodePool. Must be >= min_count | 100 | Optional | +| max_pods_per_node | The maximum number of pods per node in this cluster | 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. | 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. | 0 | Optional | | min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional | | name | The name of the node pool | | Required | | node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusers | | Required | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index d8ecd2eb5f..7ebd2b7de9 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -407,6 +407,10 @@ resource "google_container_node_pool" "pools" { auto_upgrade = lookup(each.value, "auto_upgrade", local.default_auto_upgrade) } + upgrade_settings { + max_surge = lookup(each.value, "max_surge", 1) + max_unavailable = lookup(each.value, "max_unavailable", 0) + } node_config { image_type = lookup(each.value, "image_type", "COS_CONTAINERD") diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index e7251e2710..f6b4617170 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -263,6 +263,9 @@ The node_pools variable takes the following parameters: | machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional | | min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional | | max_count | Maximum number of nodes in the NodePool. Must be >= min_count | 100 | Optional | +| max_pods_per_node | The maximum number of pods per node in this cluster | 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. | 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. | 0 | Optional | | min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional | | name | The name of the node pool | | Required | | node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusers | | Required | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index aaedfaf344..da5463d2a8 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -316,6 +316,10 @@ resource "google_container_node_pool" "pools" { auto_upgrade = lookup(each.value, "auto_upgrade", local.default_auto_upgrade) } + upgrade_settings { + max_surge = lookup(each.value, "max_surge", 1) + max_unavailable = lookup(each.value, "max_unavailable", 0) + } node_config { image_type = lookup(each.value, "image_type", "COS_CONTAINERD")