Skip to content

Commit 48d7590

Browse files
authored
feat: add enable_private_nodes options to node_pool network_config (#1604)
1 parent 53f0f58 commit 48d7590

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

autogen/main/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ The node_pools variable takes the following parameters:
221221
{% if beta_cluster %}
222222
| placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | Optional |
223223
| pod_range | The name of the secondary range for pod IPs. | | Optional |
224+
{% if not private_cluster %}
225+
| enable_private_nodes | Whether nodes have internal IP addresses only. | | Optional |
226+
{% endif %}
224227
{% endif %}
225228
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required |
226229
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,8 @@ resource "google_container_node_pool" "windows_pools" {
684684
pod_range = lookup(network_config.value, "pod_range", null)
685685
{% if private_cluster %}
686686
enable_private_nodes = var.enable_private_nodes
687+
{% else %}
688+
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
687689
{% endif %}
688690
}
689691
}

modules/beta-public-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ The node_pools variable takes the following parameters:
335335
| name | The name of the node pool | | Required |
336336
| placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | Optional |
337337
| pod_range | The name of the secondary range for pod IPs. | | Optional |
338+
| enable_private_nodes | Whether nodes have internal IP addresses only. | | Optional |
338339
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required |
339340
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |
340341
| node_metadata | Options to expose the node metadata to the workload running on the node | | Optional |

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ resource "google_container_node_pool" "pools" {
565565
dynamic "network_config" {
566566
for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : []
567567
content {
568-
pod_range = lookup(network_config.value, "pod_range", null)
568+
pod_range = lookup(network_config.value, "pod_range", null)
569+
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
569570
}
570571
}
571572

@@ -776,7 +777,8 @@ resource "google_container_node_pool" "windows_pools" {
776777
dynamic "network_config" {
777778
for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : []
778779
content {
779-
pod_range = lookup(network_config.value, "pod_range", null)
780+
pod_range = lookup(network_config.value, "pod_range", null)
781+
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
780782
}
781783
}
782784

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ The node_pools variable takes the following parameters:
313313
| name | The name of the node pool | | Required |
314314
| placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | Optional |
315315
| pod_range | The name of the secondary range for pod IPs. | | Optional |
316+
| enable_private_nodes | Whether nodes have internal IP addresses only. | | Optional |
316317
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required |
317318
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |
318319
| node_metadata | Options to expose the node metadata to the workload running on the node | | Optional |

modules/beta-public-cluster/cluster.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ resource "google_container_node_pool" "pools" {
471471
dynamic "network_config" {
472472
for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : []
473473
content {
474-
pod_range = lookup(network_config.value, "pod_range", null)
474+
pod_range = lookup(network_config.value, "pod_range", null)
475+
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
475476
}
476477
}
477478

@@ -681,7 +682,8 @@ resource "google_container_node_pool" "windows_pools" {
681682
dynamic "network_config" {
682683
for_each = length(lookup(each.value, "pod_range", "")) > 0 ? [each.value] : []
683684
content {
684-
pod_range = lookup(network_config.value, "pod_range", null)
685+
pod_range = lookup(network_config.value, "pod_range", null)
686+
enable_private_nodes = lookup(network_config.value, "enable_private_nodes", null)
685687
}
686688
}
687689

0 commit comments

Comments
 (0)