Skip to content

Commit

Permalink
feat: Add a variable that enables/disables network policies
Browse files Browse the repository at this point in the history
  • Loading branch information
omohammed95 committed May 31, 2024
1 parent 3b1bd99 commit ad8fdb5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
14 changes: 7 additions & 7 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ locals {
limits = { for k, v in var.resources.storegateway.limits : k => v if v != null }
}
networkPolicy = {
enabled = false
enabled = var.network_policy_thanos
}
extraFlags = [
# Store Gateway index cache config -> https://thanos.io/tip/components/store.md/#index-cache
Expand Down Expand Up @@ -84,7 +84,7 @@ locals {
limits = { for k, v in var.resources.query.limits : k => v if v != null }
}
networkPolicy = {
enabled = false
enabled = var.network_policy_thanos
}
}

Expand All @@ -108,7 +108,7 @@ locals {
size = local.thanos.compactor_persistence_size
}
networkPolicy = {
enabled = false
enabled = var.network_policy_thanos
}
}

Expand Down Expand Up @@ -200,7 +200,7 @@ locals {
}]
}
networkPolicy = {
enabled = false
enabled = var.network_policy_thanos
}
}

Expand Down Expand Up @@ -334,17 +334,17 @@ locals {
}]
}
networkPolicy = {
enabled = false
enabled = var.network_policy_thanos
}
}
receive = {
networkPolicy = {
enabled = false
enabled = var.network_policy_thanos
}
}
ruler = {
networkPolicy = {
enabled = false
enabled = var.network_policy_thanos
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,9 @@ variable "enable_service_monitor" {
type = bool
default = false
}

variable "network_policy_thanos" {
description = "Enable or disable network policy for Thanos components."
type = bool
default = false
}

0 comments on commit ad8fdb5

Please sign in to comment.