diff --git a/modules/gke-nodepool/main.tf b/modules/gke-nodepool/main.tf index cdd39d09..585cbd23 100644 --- a/modules/gke-nodepool/main.tf +++ b/modules/gke-nodepool/main.tf @@ -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" {