From b27bfe5714188474d0c90809b407f888da777723 Mon Sep 17 00:00:00 2001 From: pierre geeraert Date: Mon, 12 Oct 2026 00:16:07 +0100 Subject: [PATCH] not filling nodeport if the type is not nodeport --- core/services.tf | 2 +- core/variables.auto.tfvars | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 = {