Skip to content

Commit

Permalink
feat: add support for node upgrade surge (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexouzounis authored Mar 6, 2020
1 parent 8a7c2ac commit 9d05188
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resource "google_project_service" "project" {

## Modules
module "gke-cluster" {
source = "github.com/ouzi-dev/gke-terraform.git?ref=v0.6.1"
source = "github.com/ouzi-dev/gke-terraform.git?ref=v0.8.0"
#source = "../gke-terraform"
region = var.gcloud_region
project = var.gcloud_project
Expand All @@ -52,6 +52,8 @@ module "gke-cluster" {
machine_is_preemptible = var.gke_machine_is_preemptible
min_nodes = var.gke_min_nodes
max_nodes = var.gke_max_nodes
max_surge = var.max_surge
max_unavailable = var.max_unavailable

daily_maintenance = var.gke_daily_maintenance
disable_hpa = var.gke_disable_hpa
Expand All @@ -71,7 +73,7 @@ locals {
}

module "image-build-workers" {
source = "github.com/ouzi-dev/gke-terraform.git//modules/gke-workers?ref=v0.6.1"
source = "github.com/ouzi-dev/gke-terraform.git//modules/gke-workers?ref=v0.8.0"
#source = "../gke-terraform/modules/gke-workers"
region = var.gcloud_region

Expand All @@ -89,7 +91,10 @@ module "image-build-workers" {
machine_is_preemptible = var.imagebuilder_machine_is_preemptible
min_nodes = var.imagebuilder_min_nodes
max_nodes = var.imagebuilder_max_nodes
max_surge = var.max_surge
max_unavailable = var.max_unavailable
init_nodes = "0"

# NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE.
machine_taints = [
{ "key" : "imagebuilderonly",
Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ variable "gke_max_nodes" {
default = 4
}

variable "max_surge" {
default = 1
}

variable "max_unavailable" {
default = 0
}

variable "imagebuilder_machine_type" {
description = "Instance type for the image builder pool of workers"
default = "n2-standard-4"
Expand Down

0 comments on commit 9d05188

Please sign in to comment.