Skip to content

Commit 5d5e3c2

Browse files
committed
Set blue green defaults null to use provider default
1 parent 83feb3e commit 5d5e3c2

File tree

21 files changed

+106
-339
lines changed

21 files changed

+106
-339
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ The node_pools variable takes the following parameters:
278278
| total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional |
279279
| max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional |
280280
| strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional |
281-
| 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 |
282-
| 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 |
283-
| 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 |
284-
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. | "0s" | Optional |
285-
| 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 |
286-
| 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 |
287-
| min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional |
281+
| 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 |
282+
| 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 |
283+
| 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 |
284+
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. Only works with `BLUE_GREEN` strategy. | "0s" | Optional |
285+
| 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 |
286+
| 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 |
287+
| 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 |
288288
| 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 |
289289
| name | The name of the node pool | | Required |
290290
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required |

autogen/main/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ The node_pools variable takes the following parameters:
214214
| total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional |
215215
| max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional |
216216
| strategy | The upgrade stragey to be used for upgrading the nodes. Valid values of state are: `SURGE` or `BLUE_GREEN` | "SURGE" | Optional |
217-
| 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 |
218-
| 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 |
219-
| 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 |
220-
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. | "0s" | Optional |
221-
| 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 |
222-
| 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 |
223-
| min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional |
217+
| 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 |
218+
| 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 |
219+
| 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 |
220+
| batch_soak_duration | Soak time after each batch gets drained, with the default being zero seconds. Only works with `BLUE_GREEN` strategy. | "0s" | Optional |
221+
| 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 |
222+
| 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 |
223+
| 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 |
224224
| 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 |
225225
| name | The name of the node pool | | Required |
226226
{% if beta_cluster %}

autogen/main/cluster.tf.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,12 @@ resource "google_container_node_pool" "windows_pools" {
702702
dynamic "blue_green_settings" {
703703
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [1] : []
704704
content {
705-
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
705+
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", null)
706706

707707
standard_rollout_policy {
708-
batch_soak_duration = lookup(each.value, "batch_soak_duration", "0s")
708+
batch_soak_duration = lookup(each.value, "batch_soak_duration", null)
709709
batch_percentage = lookup(each.value, "batch_percentage", null)
710-
batch_node_count = lookup(each.value, "batch_node_count", 1)
710+
batch_node_count = lookup(each.value, "batch_node_count", null)
711711
}
712712
}
713713
}

autogen/main/variables.tf.tmpl

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ variable "enable_pod_security_policy" {
734734
default = false
735735
}
736736

737+
737738
variable "enable_l4_ilb_subsetting" {
738739
type = bool
739740
description = "Enable L4 ILB Subsetting on the cluster"
@@ -757,47 +758,5 @@ variable "enable_identity_service" {
757758
description = "Enable the Identity Service component, which allows customers to use external identity providers with the K8S API."
758759
default = false
759760
}
760-
761-
variable "strategy" {
762-
type = string
763-
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)"
764-
default = "SURGE"
765-
}
766-
767-
variable "max_surge" {
768-
type = number
769-
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)"
770-
default = null
771-
}
772-
773-
variable "max_unavailable" {
774-
type = number
775-
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)"
776-
default = null
777-
}
778-
779-
variable "node_pool_soak_duration" {
780-
type = string
781-
description = "Time needed after draining the entire blue pool. After this period, the blue pool will be cleaned up (Optional)"
782-
default = "3600s"
783-
}
784-
785-
variable "batch_soak_duration" {
786-
type = string
787-
description = "Soak time after each batch gets drained (Optionial)"
788-
default = "0s"
789-
}
790-
791-
variable "batch_percentage" {
792-
type = string
793-
description = "Percentage of the blue pool nodes to drain in a batch (Optional)"
794-
default = null
795-
}
796-
797-
variable "batch_node_count" {
798-
type = number
799-
description = "The number of blue nodes to drain in a batch (Optional)"
800-
default = null
801-
}
802761
{% endif %}
803762
{% endif %}

cluster.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,12 @@ resource "google_container_node_pool" "pools" {
413413
dynamic "blue_green_settings" {
414414
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [1] : []
415415
content {
416-
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
416+
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", null)
417417

418418
standard_rollout_policy {
419-
batch_soak_duration = lookup(each.value, "batch_soak_duration", "0s")
419+
batch_soak_duration = lookup(each.value, "batch_soak_duration", null)
420420
batch_percentage = lookup(each.value, "batch_percentage", null)
421-
batch_node_count = lookup(each.value, "batch_node_count", 1)
421+
batch_node_count = lookup(each.value, "batch_node_count", null)
422422
}
423423
}
424424
}
@@ -599,12 +599,12 @@ resource "google_container_node_pool" "windows_pools" {
599599
dynamic "blue_green_settings" {
600600
for_each = lookup(each.value, "strategy", "SURGE") == "BLUE_GREEN" ? [1] : []
601601
content {
602-
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", "3600s")
602+
node_pool_soak_duration = lookup(each.value, "node_pool_soak_duration", null)
603603

604604
standard_rollout_policy {
605-
batch_soak_duration = lookup(each.value, "batch_soak_duration", "0s")
605+
batch_soak_duration = lookup(each.value, "batch_soak_duration", null)
606606
batch_percentage = lookup(each.value, "batch_percentage", null)
607-
batch_node_count = lookup(each.value, "batch_node_count", 1)
607+
batch_node_count = lookup(each.value, "batch_node_count", null)
608608
}
609609
}
610610
}

0 commit comments

Comments
 (0)