add middlewares for nextcloud
This commit is contained in:
+21
-14
@@ -1,15 +1,16 @@
|
||||
variable "kubernetes_input" {
|
||||
type = map(object({
|
||||
name = optional(string)
|
||||
docker = optional(bool)
|
||||
namespace = optional(string)
|
||||
connected_namespace = optional(string, "")
|
||||
service_port = optional(list(number))
|
||||
service_type = optional(string, "ClusterIP")
|
||||
domain_name = optional(list(string))
|
||||
legacy_domain = optional(bool, false)
|
||||
exposed = optional(bool, true)
|
||||
enabled = optional(bool, true)
|
||||
name = optional(string)
|
||||
docker = optional(bool)
|
||||
namespace = optional(string)
|
||||
connected_namespace = optional(string, "")
|
||||
service_port = optional(list(number))
|
||||
service_type = optional(string, "ClusterIP")
|
||||
domain_name = optional(list(string))
|
||||
middlewares = optional(string)
|
||||
legacy_domain = optional(bool, false)
|
||||
exposed = optional(bool, true)
|
||||
enabled = optional(bool, true)
|
||||
}))
|
||||
|
||||
}
|
||||
@@ -23,10 +24,16 @@ resource "kubernetes_ingress_v1" "automatic_ingress" {
|
||||
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"
|
||||
}
|
||||
annotations = merge(
|
||||
{
|
||||
"cert-manager.io/cluster-issuer" = "letsencrypt-prod"
|
||||
"traefik.ingress.kubernetes.io/router.entrypoints" = "websecure"
|
||||
},
|
||||
# Simply injects the middleware string if it is present and not empty
|
||||
lookup(each.value, "middlewares", "") != "" ? {
|
||||
"traefik.ingress.kubernetes.io/router.middlewares" = each.value.middlewares
|
||||
} : {}
|
||||
)
|
||||
}
|
||||
|
||||
spec {
|
||||
|
||||
Reference in New Issue
Block a user