Skip to content

Commit

Permalink
fix!: enable private nodes with specified pod ip range (#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
splichy committed Jan 10, 2023
1 parent 169967c commit 8190439
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,10 @@ 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)
{% if private_cluster %}
enable_private_nodes = var.enable_private_nodes
{% endif %}
}
}
{% endif %}
Expand Down
6 changes: 4 additions & 2 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,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
}
}

Expand Down Expand Up @@ -789,7 +790,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
}
}

Expand Down
6 changes: 4 additions & 2 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,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
}
}

Expand Down Expand Up @@ -694,7 +695,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
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ terraform {
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.3"
version = "~> 4.45"
}
random = {
source = "hashicorp/random"
Expand Down

0 comments on commit 8190439

Please sign in to comment.