[#374] Add taint when Windows node pools are created to match the one GKE implicitly adds

This commit is contained in:
Luca Prete 2021-12-03 14:15:51 +01:00 committed by GitHub
parent 7bf372305e
commit 8e8f4d2117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -51,7 +51,22 @@ locals {
"effect" = lookup(local.node_taint_effect, element(split(":", taint), 1)),
}
]
node_taints = local.temp_node_pools_taints
# The taint is added to match the one that
# GKE implicitly adds when Windows node pools are created.
win_node_pools_taint = (
var.node_image_type == null
? []
: length(regexall("WINDOWS", var.node_image_type)) > 0
? [
{
"key" = "node.kubernetes.io/os"
"value" = "windows"
"effect" = local.node_taint_effect.NoSchedule
}
]
: []
)
node_taints = concat(local.temp_node_pools_taints, local.win_node_pools_taint)
}
resource "google_service_account" "service_account" {