Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add drain_timeout_in_minutes and node_soak_duration_in_minutes #564

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions extra_node_pool.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool_create_before_destroy
for_each = each.value.upgrade_settings == null ? [] : ["upgrade_settings"]

content {
max_surge = each.value.upgrade_settings.max_surge
drain_timeout_in_minutes = each.value.upgrade_settings.drain_timeout_in_minutes
node_soak_duration_in_minutes = each.value.upgrade_settings.node_soak_duration_in_minutes
max_surge = each.value.upgrade_settings.max_surge
}
}
dynamic "windows_profile" {
Expand Down Expand Up @@ -283,7 +285,9 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool_create_after_destroy"
for_each = each.value.upgrade_settings == null ? [] : ["upgrade_settings"]

content {
max_surge = each.value.upgrade_settings.max_surge
drain_timeout_in_minutes = each.value.upgrade_settings.drain_timeout_in_minutes
node_soak_duration_in_minutes = each.value.upgrade_settings.node_soak_duration_in_minutes
max_surge = each.value.upgrade_settings.max_surge
}
}
dynamic "windows_profile" {
Expand Down
8 changes: 6 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ resource "azurerm_kubernetes_cluster" "main" {
for_each = var.agents_pool_max_surge == null ? [] : ["upgrade_settings"]

content {
max_surge = var.agents_pool_max_surge
drain_timeout_in_minutes = var.agents_pool_drain_timeout_in_minutes
node_soak_duration_in_minutes = var.agents_pool_node_soak_duration_in_minutes
max_surge = var.agents_pool_max_surge
}
}
}
Expand Down Expand Up @@ -247,7 +249,9 @@ resource "azurerm_kubernetes_cluster" "main" {
for_each = var.agents_pool_max_surge == null ? [] : ["upgrade_settings"]

content {
max_surge = var.agents_pool_max_surge
drain_timeout_in_minutes = var.agents_pool_drain_timeout_in_minutes
node_soak_duration_in_minutes = var.agents_pool_node_soak_duration_in_minutes
max_surge = var.agents_pool_max_surge
}
}
}
Expand Down
20 changes: 18 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ variable "agents_pool_max_surge" {
description = "The maximum number or percentage of nodes which will be added to the Default Node Pool size during an upgrade."
}

variable "agents_pool_node_soak_duration_in_minutes" {
type = number
default = 0
description = "(Optional) The amount of time in minutes to wait after draining a node and before reimaging and moving on to next node. Defaults to 0."
}

variable "agents_pool_drain_timeout_in_minutes" {
type = number
default = 30
description = "(Optional) The amount of time in minutes to wait on eviction of pods and graceful termination per node. This eviction wait time honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. Unsetting this after configuring it will force a new resource to be created."
}

variable "agents_pool_name" {
type = string
default = "nodepool"
Expand Down Expand Up @@ -1030,7 +1042,9 @@ variable "node_pools" {
ultra_ssd_enabled = optional(bool)
vnet_subnet_id = optional(string)
upgrade_settings = optional(object({
max_surge = string
drain_timeout_in_minutes = number
node_soak_duration_in_minutes = number
max_surge = string
}))
windows_profile = optional(object({
outbound_nat_enabled = optional(bool, true)
Expand Down Expand Up @@ -1130,7 +1144,9 @@ variable "node_pools" {
ultra_ssd_enabled = (Optional) Used to specify whether the UltraSSD is enabled in the Node Pool. Defaults to `false`. See [the documentation](https://docs.microsoft.com/azure/aks/use-ultra-disks) for more information. Changing this forces a new resource to be created.
vnet_subnet_id = (Optional) The ID of the Subnet where this Node Pool should exist. Changing this forces a new resource to be created. A route table must be configured on this Subnet.
upgrade_settings = optional(object({
max_surge = string
drain_timeout_in_minutes = number
node_soak_duration_in_minutes = number
max_surge = string
}))
windows_profile = optional(object({
outbound_nat_enabled = optional(bool, true)
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.84.0, < 4.0"
version = ">= 3.106.1, < 4.0"
}
null = {
source = "hashicorp/null"
Expand Down
Loading