Skip to content

Commit

Permalink
feat: add support for node upgrade surge (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexouzounis authored Mar 6, 2020
1 parent a01ad9c commit dd13b3c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ module "default_workers" {
min_nodes = var.min_nodes
max_nodes = var.max_nodes
init_nodes = var.init_nodes
max_surge = var.max_surge
max_unavailable = var.max_unavailable
}
2 changes: 1 addition & 1 deletion modules/gke-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ resource "google_container_cluster" "k8s-cluster" {
}
istio_config {
disabled = var.disable_istio
auth = var.istio_config_auth
auth = var.istio_config_auth
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions modules/gke-workers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,10 @@ resource "google_container_node_pool" "k8s-worker-pool" {
max_node_count = var.max_nodes
min_node_count = var.min_nodes
}

upgrade_settings {
max_surge = var.max_surge
max_unavailable = var.max_unavailable
}
}

5 changes: 5 additions & 0 deletions modules/gke-workers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ variable "max_nodes" {
variable "init_nodes" {
}

variable "max_surge" {
}

variable "max_unavailable" {
}
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ variable "max_nodes" {
description = "Max number of workers"
}

variable "max_surge" {
default = 1
}

variable "max_unavailable" {
default = 0
}

variable "daily_maintenance" {
default = "02:00"
}
Expand Down

0 comments on commit dd13b3c

Please sign in to comment.