Skip to content

Commit

Permalink
feat: promote max_pods_per_node, max_surge, and max_unavailable
Browse files Browse the repository at this point in the history
… fields to ga (#1318)

* promote fields to ga

* revert network_config
  • Loading branch information
DrFaust92 authored Jul 19, 2022
1 parent cff4428 commit ed64058
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 0 additions & 2 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
2 changes: 0 additions & 2 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ed64058

Please sign in to comment.