Skip to content

Commit

Permalink
feat: allow traefik to bucketweb and queryFrontend
Browse files Browse the repository at this point in the history
  • Loading branch information
omohammed95 committed Aug 20, 2024
1 parent 4a8ac12 commit a98ad02
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module "thanos" {
enable_service_monitor = var.enable_service_monitor
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids
network_policy_thanos = var.network_policy_thanos
enable_network_policies = var.enable_network_policies

resources = var.resources

Expand Down
2 changes: 1 addition & 1 deletion eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module "thanos" {
enable_service_monitor = var.enable_service_monitor
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids
network_policy_thanos = var.network_policy_thanos
enable_network_policies = var.enable_network_policies

resources = var.resources

Expand Down
2 changes: 1 addition & 1 deletion kind/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module "thanos" {
enable_service_monitor = var.enable_service_monitor
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids
network_policy_thanos = var.network_policy_thanos
enable_network_policies = var.enable_network_policies

resources = var.resources

Expand Down
36 changes: 29 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 = var.network_policy_thanos
enabled = var.enable_network_policies
}
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 = var.network_policy_thanos
enabled = var.enable_network_policies
}
}

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

Expand Down Expand Up @@ -200,7 +200,18 @@ locals {
}]
}
networkPolicy = {
enabled = var.network_policy_thanos
enabled = var.enable_network_policies
extraIngress = var.enable_network_policies ? [
{
from = {
namespaceSelector = {
matchLabels = {
"app.kubernetes.io/metadata.name" = "traefik"
}
}
}
}
] : []
}
}

Expand Down Expand Up @@ -334,17 +345,28 @@ locals {
}]
}
networkPolicy = {
enabled = var.network_policy_thanos
enabled = var.enable_network_policies
extraIngress = var.enable_network_policies ? [
{
from = {
namespaceSelector = {
matchLabels = {
"app.kubernetes.io/metadata.name" = "traefik"
}
}
}
}
] : []
}
}
receive = {
networkPolicy = {
enabled = var.network_policy_thanos
enabled = var.enable_network_policies
}
}
ruler = {
networkPolicy = {
enabled = var.network_policy_thanos
enabled = var.enable_network_policies
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module "thanos" {
enable_service_monitor = var.enable_service_monitor
app_autosync = var.app_autosync
dependency_ids = var.dependency_ids
network_policy_thanos = var.network_policy_thanos
enable_network_policies = var.enable_network_policies

resources = var.resources

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ variable "enable_service_monitor" {
default = false
}

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

0 comments on commit a98ad02

Please sign in to comment.