Skip to content

Commit f22b9bd

Browse files
Update min_node_count and max_node_count in autogen to ensure conflicts with zonal limits do not happen.
1 parent b96eda3 commit f22b9bd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

autogen/main/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,13 @@ The node_pools variable takes the following parameters:
210210
{% endif %}
211211
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
212212
| 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 |
213-
| max_count | Maximum number of nodes in the NodePool. Must be >= min_count | 100 | Optional |
213+
| max_count | Maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with total limits. | 100 | Optional |
214+
| total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional |
214215
| max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional |
215216
| 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 |
216217
| 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 |
217-
| min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional |
218+
| min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with total limits. | 1 | Optional |
219+
| total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional |
218220
| name | The name of the node pool | | Required |
219221
{% if beta_cluster %}
220222
| placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ resource "google_container_node_pool" "windows_pools" {
652652
dynamic "autoscaling" {
653653
for_each = lookup(each.value, "autoscaling", true) ? [each.value] : []
654654
content {
655-
min_node_count = lookup(autoscaling.value, "min_count", 1)
656-
max_node_count = lookup(autoscaling.value, "max_count", 100)
655+
min_node_count = contains(keys(autoscaling.value), "total_min_count") ? null : lookup(autoscaling.value, "min_count", 1)
656+
max_node_count = contains(keys(autoscaling.value), "total_max_count") ? null : lookup(autoscaling.value, "max_count", 100)
657657
location_policy = lookup(autoscaling.value, "location_policy", null)
658658
total_min_node_count = lookup(autoscaling.value, "total_min_count", null)
659659
total_max_node_count = lookup(autoscaling.value, "total_max_count", null)

0 commit comments

Comments
 (0)