diff --git a/init.tf b/init.tf index 7f7e021..a29de23 100644 --- a/init.tf +++ b/init.tf @@ -101,6 +101,7 @@ resource "null_resource" "kustomization" { location = var.location traefik_acme_tls = var.traefik_acme_tls traefik_acme_email = var.traefik_acme_email + traefik_additionalOptions = var.traefik_additionalOptions }) destination = "/tmp/post_install/traefik.yaml" } diff --git a/templates/traefik_config.yaml.tpl b/templates/traefik_config.yaml.tpl index 75ce20f..098d754 100644 --- a/templates/traefik_config.yaml.tpl +++ b/templates/traefik_config.yaml.tpl @@ -24,6 +24,9 @@ spec: - "--entryPoints.websecure.proxyProtocol.trustedIPs=127.0.0.1/32,10.0.0.0/8" - "--entryPoints.web.forwardedHeaders.trustedIPs=127.0.0.1/32,10.0.0.0/8" - "--entryPoints.websecure.forwardedHeaders.trustedIPs=127.0.0.1/32,10.0.0.0/8" +%{ for option in traefik_additionalOptions ~} + - "${option}" +%{ endfor ~} %{ if traefik_acme_tls ~} - "--certificatesresolvers.le.acme.tlschallenge=true" - "--certificatesresolvers.le.acme.email=${traefik_acme_email}" diff --git a/terraform.tfvars.example b/terraform.tfvars.example index 047c8bc..8c9c842 100644 --- a/terraform.tfvars.example +++ b/terraform.tfvars.example @@ -78,3 +78,7 @@ load_balancer_type = "lb11" # ] # }, # ] + +# If you want to configure additional Arguments for traefik, enter them here as a list and in the form of traefik CLI arguments; see https://doc.traefik.io/traefik/reference/static-configuration/cli/ +# Example: traefik_additionalOptions = ["--log.level=DEBUG", "--tracing=true"] +# traefik_additionalOptions = [] diff --git a/variables.tf b/variables.tf index 15ecb17..eb30850 100644 --- a/variables.tf +++ b/variables.tf @@ -119,3 +119,8 @@ variable "extra_firewall_rules" { default = [] description = "Additional firewall rules to apply to the cluster" } + +variable "traefik_additionalOptions" { + type = list(string) + default = [] +}