not filling nodeport if the type is not nodeport

This commit is contained in:
pierre geeraert
2026-10-12 00:16:07 +01:00
parent 437891b2d4
commit b27bfe5714
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ resource "kubernetes_service_v1" "automatic_service" {
port = port.value port = port.value
target_port = port.value target_port = port.value
name = replace("${port.value}${each.key}", "/(.{0,15})(.*)/", "$1") name = replace("${port.value}${each.key}", "/(.{0,15})(.*)/", "$1")
node_port = port.value node_port = each.value.service_type == "NodePort" ? port.value : 0
} }
} }
+2 -1
View File
@@ -1,9 +1,10 @@
kubernetes = { kubernetes = {
reverse-proxy = { reverse-proxy = {
enabled = false #enabled = false
#docker = true #docker = true
image = "nginx:latest" image = "nginx:latest"
service_port = [80, 443] service_port = [80, 443]
service_type = "NodePort"
external_port = true external_port = true
pvc = { pvc = {
nginx-sites-terraform = { nginx-sites-terraform = {