2022-04-01 09:25:19 +02:00
|
|
|
# Traefik Deployment
|
2022-03-17 13:09:48 +01:00
|
|
|
|
2022-04-01 09:25:19 +02:00
|
|
|
resource "kubernetes_namespace" "traefik" {
|
|
|
|
|
|
|
|
depends_on = [
|
|
|
|
time_sleep.wait_for_kubernetes
|
|
|
|
]
|
2022-03-17 13:09:48 +01:00
|
|
|
|
|
|
|
metadata {
|
|
|
|
name = "traefik"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "helm_release" "traefik" {
|
2022-04-01 09:25:19 +02:00
|
|
|
depends_on = [
|
|
|
|
kubernetes_namespace.traefik
|
|
|
|
]
|
2022-03-17 13:09:48 +01:00
|
|
|
|
|
|
|
name = "traefik"
|
|
|
|
namespace = "traefik"
|
|
|
|
|
|
|
|
repository = "https://helm.traefik.io/traefik"
|
2022-04-01 09:25:19 +02:00
|
|
|
chart = "traefik"
|
2022-03-17 13:09:48 +01:00
|
|
|
|
|
|
|
# Set Traefik as the Default Ingress Controller
|
|
|
|
set {
|
|
|
|
name = "ingressClass.enabled"
|
|
|
|
value = "true"
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
name = "ingressClass.isDefaultClass"
|
|
|
|
value = "true"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Default Redirect
|
|
|
|
set {
|
|
|
|
name = "ports.web.redirectTo"
|
|
|
|
value = "websecure"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Enable TLS on Websecure
|
|
|
|
set {
|
|
|
|
name = "ports.websecure.tls.enabled"
|
|
|
|
value = "true"
|
|
|
|
}
|
|
|
|
|
2024-02-22 19:01:59 +01:00
|
|
|
}
|