From 48f5650f72684b581697f8831b3f5b60ea624092 Mon Sep 17 00:00:00 2001 From: Heron Rossi Date: Thu, 27 Oct 2022 11:17:50 -0300 Subject: [PATCH] Don't apply match all toleration if specifying custom ones --- controller.tf | 6 +----- node.tf | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/controller.tf b/controller.tf index e090d47..822c3d8 100644 --- a/controller.tf +++ b/controller.tf @@ -33,12 +33,8 @@ resource "kubernetes_deployment" "ebs_csi_controller" { automount_service_account_token = true priority_class_name = "system-cluster-critical" - toleration { - operator = "Exists" - } - dynamic "toleration" { - for_each = var.csi_controller_tolerations + for_each = length(var.csi_controller_tolerations) > 0 ? var.csi_controller_tolerations : [{ operator = "Exists" }] content { key = lookup(toleration.value, "key", null) operator = lookup(toleration.value, "operator", null) diff --git a/node.tf b/node.tf index 0082d01..a563db2 100644 --- a/node.tf +++ b/node.tf @@ -53,12 +53,8 @@ resource "kubernetes_daemonset" "node" { automount_service_account_token = true priority_class_name = "system-node-critical" - toleration { - operator = "Exists" - } - dynamic "toleration" { - for_each = var.node_tolerations + for_each = length(var.node_tolerations) > 0 ? var.csi_controller_tolerations : [{ operator = "Exists" }] content { key = lookup(toleration.value, "key", null) operator = lookup(toleration.value, "operator", null)