From 2353322d0b0d2d0fa60d231b002dffffcfb7e7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20=C5=A0pl=C3=ADchal?= Date: Fri, 30 Dec 2022 12:19:05 +0100 Subject: [PATCH 1/2] fix: enable private nodes with pod_ip_range fixes #1493 --- autogen/main/cluster.tf.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 68476199f5..3efe9f97c7 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -659,7 +659,8 @@ resource "google_container_node_pool" "windows_pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } {% endif %} From 4773d55f523222fdc595a4778d45a8b98e2493f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20=C5=A0pl=C3=ADchal?= Date: Fri, 30 Dec 2022 12:26:59 +0100 Subject: [PATCH 2/2] autogen --- modules/beta-private-cluster-update-variant/cluster.tf | 6 ++++-- modules/beta-private-cluster/cluster.tf | 6 ++++-- modules/beta-public-cluster-update-variant/cluster.tf | 6 ++++-- modules/beta-public-cluster/cluster.tf | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index e9cbce1917..8f98fedb4a 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -568,7 +568,8 @@ resource "google_container_node_pool" "pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } @@ -779,7 +780,8 @@ resource "google_container_node_pool" "windows_pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 0040d5d9bf..b1595e98cc 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -474,7 +474,8 @@ resource "google_container_node_pool" "pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } @@ -684,7 +685,8 @@ resource "google_container_node_pool" "windows_pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index 09938b2cb2..fd3bf25a35 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -549,7 +549,8 @@ resource "google_container_node_pool" "pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } @@ -760,7 +761,8 @@ resource "google_container_node_pool" "windows_pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index 8ced172253..514b006525 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -455,7 +455,8 @@ resource "google_container_node_pool" "pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } } @@ -665,7 +666,8 @@ resource "google_container_node_pool" "windows_pools" { dynamic "network_config" { for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : [] content { - pod_range = lookup(network_config.value, "pod_range", null) + pod_range = lookup(network_config.value, "pod_range", null) + enable_private_nodes = var.enable_private_nodes } }