diff --git a/core/services.tf b/core/services.tf index a18d8b9..7f2d7f2 100644 --- a/core/services.tf +++ b/core/services.tf @@ -23,7 +23,7 @@ resource "kubernetes_service_v1" "automatic_service" { port = port.value target_port = port.value name = replace("${port.value}${each.key}", "/(.{0,15})(.*)/", "$1") - node_port = port.value + node_port = each.value.service_type == "NodePort" ? port.value : 0 } } diff --git a/core/variables.auto.tfvars b/core/variables.auto.tfvars index 46b0336..122b837 100644 --- a/core/variables.auto.tfvars +++ b/core/variables.auto.tfvars @@ -1,9 +1,10 @@ kubernetes = { reverse-proxy = { - enabled = false + #enabled = false #docker = true image = "nginx:latest" service_port = [80, 443] + service_type = "NodePort" external_port = true pvc = { nginx-sites-terraform = {