use ingress factory for all hosted ingresses [ci skip]

This commit is contained in:
Viktor Barzin 2025-01-14 22:53:04 +00:00
parent 8713946352
commit d0e68769e7
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
41 changed files with 392 additions and 1628 deletions

View file

@ -136,55 +136,10 @@ resource "kubernetes_service" "netbox" {
}
}
}
resource "kubernetes_ingress_v1" "netbox" {
metadata {
name = "netbox"
namespace = "netbox"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
# "nginx.ingress.kubernetes.io/proxy-body-size" : "5000m"
"nginx.ingress.kubernetes.io/auth-url" : "https://oauth2.viktorbarzin.me/oauth2/auth"
"nginx.ingress.kubernetes.io/auth-signin" : "https://oauth2.viktorbarzin.me/oauth2/start?rd=/redirect/$http_host$escaped_request_uri"
}
}
spec {
tls {
hosts = ["netbox.viktorbarzin.me"]
secret_name = var.tls_secret_name
}
rule {
host = "netbox.viktorbarzin.me"
http {
path {
path = "/"
backend {
service {
name = "netbox"
port {
number = 80
}
}
}
}
}
}
rule {
host = "books.viktorbarzin.me"
http {
path {
path = "/"
backend {
service {
name = "netbox"
port {
number = 80
}
}
}
}
}
}
}
module "ingress" {
source = "../ingress_factory"
namespace = "netbox"
name = "netbox"
tls_secret_name = var.tls_secret_name
protected = true
}