[ci skip] Refactor raw ingresses to use ingress_factory module

Enhance ingress_factory with full_host, extra_middlewares, and
skip_default_rate_limit variables. Fix TLS hosts bug to use
effective_host. Migrate 13 services from raw kubernetes_ingress_v1
resources to centralized ingress_factory module calls, removing
manual rybbit middleware CRDs where the factory now handles them.
This commit is contained in:
Viktor Barzin 2026-02-10 21:11:46 +00:00
parent 70376b623e
commit 6d6ec0c1e2
13 changed files with 161 additions and 582 deletions

View file

@ -210,39 +210,11 @@ resource "kubernetes_service" "oauth_proxy" {
}
}
resource "kubernetes_ingress_v1" "oauth" {
metadata {
name = "oauth2"
namespace = "oauth2"
annotations = {
"traefik.ingress.kubernetes.io/router.middlewares" = "traefik-rate-limit@kubernetescrd,traefik-csp-headers@kubernetescrd,traefik-crowdsec@kubernetescrd"
"traefik.ingress.kubernetes.io/router.entrypoints" = "websecure"
}
}
spec {
ingress_class_name = "traefik"
tls {
hosts = ["oauth2.viktorbarzin.me"]
secret_name = var.tls_secret_name
}
rule {
host = "oauth2.viktorbarzin.me"
http {
path {
path = "/"
backend {
service {
name = "oauth2"
port {
number = 80
}
}
}
}
}
}
}
module "ingress" {
source = "../ingress_factory"
namespace = "oauth2"
name = "oauth2"
tls_secret_name = var.tls_secret_name
}