Skip to content

Commit

Permalink
Set blue green defaults null to use provider default
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgEsteves committed Mar 7, 2023
1 parent 73d25be commit 6799ff4
Show file tree
Hide file tree
Showing 21 changed files with 106 additions and 339 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ 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 |
| 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 |
| 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). | "3600s" | Optional |
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. | "0s" | Optional |
| batch_node_count | Absolute number of nodes to drain in a batch. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_percentage` | 1 | Optional |
| batch_percentage | Percentage of nodes to drain in a batch. Must be in the range of [0.0, 1.0]. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_node_count` | null | 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 |
| 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 |
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. Only works with `BLUE_GREEN` strategy. | "0s" | Optional |
| batch_node_count | Absolute number of nodes to drain in a batch. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_percentage`. Only works with `BLUE_GREEN` strategy. | 1 | Optional |
| batch_percentage | Percentage of nodes to drain in a batch. Must be in the range of [0.0, 1.0]. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_node_count`. Only works with `BLUE_GREEN` strategy. | null | Optional |
| 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 |
| 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 |
| 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 clusters | | Required |
Expand Down
14 changes: 7 additions & 7 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ 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 |
| 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 |
| 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). | "3600s" | Optional |
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. | "0s" | Optional |
| batch_node_count | Absolute number of nodes to drain in a batch. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_percentage` | 1 | Optional |
| batch_percentage | Percentage of nodes to drain in a batch. Must be in the range of [0.0, 1.0]. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_node_count` | null | 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 |
| 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 |
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. Only works with `BLUE_GREEN` strategy. | "0s" | Optional |
| batch_node_count | Absolute number of nodes to drain in a batch. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_percentage`. Only works with `BLUE_GREEN` strategy. | 1 | Optional |
| batch_percentage | Percentage of nodes to drain in a batch. Must be in the range of [0.0, 1.0]. If it is set to zero, this phase will be skipped. Cannot be used together with `batch_node_count`. Only works with `BLUE_GREEN` strategy. | null | Optional |
| 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 |
| 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 |
| name | The name of the node pool | | Required |
{% if beta_cluster %}
Expand Down
6 changes: 3 additions & 3 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,12 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "blue_green_settings" {
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [1] : []
content {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", null)

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "0s")
batch_soak_duration = lookup(each.value, "batch_soak_duration", null)
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", 1)
batch_node_count = lookup(each.value, "batch_node_count", null)
}
}
}
Expand Down
43 changes: 1 addition & 42 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ variable "enable_pod_security_policy" {
default = false
}


variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster"
Expand All @@ -757,47 +758,5 @@ variable "enable_identity_service" {
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
default = false
}

variable "strategy" {
type = string
description = "The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE`; `BLUE_GREEN`. By default strategy is `SURGE` (Optional)"
default = "SURGE"
}

variable "max_surge" {
type = number
description = "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 (Optional)"
default = null
}

variable "max_unavailable" {
type = number
description = "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 (Optional)"
default = null
}

variable "node_pool_soak_duration" {
type = string
description = "Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up (Optional)"
default = "3600s"
}

variable "batch_soak_duration" {
type = string
description = "Soak time after each batch gets drained (Optionial)"
default = "0s"
}

variable "batch_percentage" {
type = string
description = "Percentage of the blue pool nodes to drain in a batch (Optional)"
default = null
}

variable "batch_node_count" {
type = number
description = "The number of blue nodes to drain in a batch (Optional)"
default = null
}
{% endif %}
{% endif %}
12 changes: 6 additions & 6 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,12 @@ resource "google_container_node_pool" "pools" {
dynamic "blue_green_settings" {
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [1] : []
content {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", null)

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "0s")
batch_soak_duration = lookup(each.value, "batch_soak_duration", null)
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", 1)
batch_node_count = lookup(each.value, "batch_node_count", null)
}
}
}
Expand Down Expand Up @@ -599,12 +599,12 @@ resource "google_container_node_pool" "windows_pools" {
dynamic "blue_green_settings" {
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [1] : []
content {
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", null)

standard_rollout_policy {
batch_soak_duration = lookup(each.value, "batch_soak_duration", "0s")
batch_soak_duration = lookup(each.value, "batch_soak_duration", null)
batch_percentage = lookup(each.value, "batch_percentage", null)
batch_node_count = lookup(each.value, "batch_node_count", 1)
batch_node_count = lookup(each.value, "batch_node_count", null)
}
}
}
Expand Down
Loading

0 comments on commit 6799ff4

Please sign in to comment.