two ingress instead
This commit is contained in:
+23
-1
@@ -14,7 +14,7 @@ resource "kubernetes_ingress_v1" "automatic_ingress" {
|
||||
ingress_class_name = "traefik"
|
||||
# Dynamic TLS configuration for cert-manager
|
||||
tls {
|
||||
hosts = [join(".", [coalesce(each.value.domain_name, each.key), "geeraert.eu"]),join(".", [coalesce(each.value.domain_name, each.key), "tryton.geeraert.eu"])]
|
||||
hosts = [join(".", [coalesce(each.value.domain_name, each.key), "geeraert.eu"])]
|
||||
secret_name = "${each.key}-tls-secret" # cert-manager will create and manage this secret automatically
|
||||
}
|
||||
|
||||
@@ -34,6 +34,28 @@ resource "kubernetes_ingress_v1" "automatic_ingress" {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
resource "kubernetes_ingress_v1" "automatic_ingress_tryton" {
|
||||
for_each = { for key, value in var.kubernetes : key => value if value.service_port != null && value.enabled == true && value.docker != true && value.exposed == true }
|
||||
metadata {
|
||||
name = "${each.key}-ingress"
|
||||
namespace = coalesce(each.value.namespace, each.value.connected_namespace, each.key)
|
||||
|
||||
annotations = {
|
||||
"cert-manager.io/cluster-issuer" = "letsencrypt-prod"
|
||||
"traefik.ingress.kubernetes.io/router.entrypoints" = "websecure"
|
||||
}
|
||||
}
|
||||
|
||||
spec {
|
||||
ingress_class_name = "traefik"
|
||||
# Dynamic TLS configuration for cert-manager
|
||||
tls {
|
||||
hosts = [join(".", [coalesce(each.value.domain_name, each.key), "tryton.geeraert.eu"])]
|
||||
secret_name = "${each.key}-tryton-tls-secret" # cert-manager will create and manage this secret automatically
|
||||
}
|
||||
|
||||
rule {
|
||||
host = join(".", [coalesce(each.value.domain_name, each.key), "tryton.geeraert.eu"])
|
||||
http {
|
||||
|
||||
Reference in New Issue
Block a user