From c670de5310d1ec8c68f15f5d12345965833fef9d Mon Sep 17 00:00:00 2001 From: Emir Aurelio Rios Date: Mon, 2 Dec 2024 12:05:40 -0500 Subject: [PATCH] add support for tolerations --- cluster/k8s.tf | 22 ++++++++++++++++++++++ cluster/variables.tf | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/cluster/k8s.tf b/cluster/k8s.tf index 563d274..c431378 100644 --- a/cluster/k8s.tf +++ b/cluster/k8s.tf @@ -226,6 +226,17 @@ resource "kubernetes_deployment" "kube_state_metrics" { } } } + + dynamic "toleration" { + for_each = var.kube_state_tolerations + content { + key = toleration.value.key + operator = toleration.value.operator + value = toleration.value.value + effect = toleration.value.effect + } + } + } } } @@ -537,6 +548,17 @@ resource "kubernetes_deployment" "collector" { } } } + + dynamic "toleration" { + for_each = var.otel_tolerations + content { + key = toleration.value.key + operator = toleration.value.operator + value = toleration.value.value + effect = toleration.value.effect + } + } + } } } diff --git a/cluster/variables.tf b/cluster/variables.tf index 2a9bff6..6e097b3 100644 --- a/cluster/variables.tf +++ b/cluster/variables.tf @@ -72,3 +72,25 @@ variable "otel_resources" { default = {} } + +variable "kube_state_tolerations" { + type = list(object({ + key = optional(string) + operator = optional(string) + value = optional(string) + effect = optional(string) + })) + + default = [] +} + +variable "otel_tolerations" { + type = list(object({ + key = optional(string) + operator = optional(string) + value = optional(string) + effect = optional(string) + })) + + default = [] +}