Skip to content

Commit

Permalink
add support for tolerations
Browse files Browse the repository at this point in the history
  • Loading branch information
mskdenigma committed Dec 2, 2024
1 parent a2a0afb commit c670de5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cluster/k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

}
}
}
Expand Down Expand Up @@ -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
}
}

}
}
}
Expand Down
22 changes: 22 additions & 0 deletions cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
}

0 comments on commit c670de5

Please sign in to comment.