made some work on the ingress

This commit is contained in:
pi-ux-ce@ARES
2026-10-13 11:27:41 +01:00
parent a0d77cc2d6
commit be06a539ea
4 changed files with 52 additions and 7 deletions
+28
View File
@@ -1,3 +1,31 @@
resource "kubernetes_ingress_v1" "automatic_ingress" {
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)
}
spec {
ingress_class_name = "traefik"
rule {
host = join(".", [coalesce(each.value.domain_name, each.key), "geeraert.eu"])
http {
path {
path = "/"
backend {
service {
name = "${each.key}-svc"
port {
number = each.value.service_port[0] #selecting the first of the list
}
}
}
}
}
}
}
}
resource "kubernetes_service_v1" "automatic_service" {
for_each = { for key, value in var.kubernetes : key => value if value.service_port != null && value.enabled == true && value.docker != true }
metadata {