File tree Expand file tree Collapse file tree 16 files changed +112
-16
lines changed
beta-autopilot-private-cluster
beta-autopilot-public-cluster
beta-private-cluster-update-variant
beta-public-cluster-update-variant
private-cluster-update-variant Expand file tree Collapse file tree 16 files changed +112
-16
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,13 @@ locals {
147147{% if private_cluster %}
148148 cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.enable_private_endpoint || var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config[0].private_endpoint : google_container_cluster.primary.private_cluster_config[0].public_endpoint) : google_container_cluster.primary.endpoint
149149 cluster_peering_name = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? google_container_cluster.primary.private_cluster_config[0].peering_name : null
150- cluster_endpoint_for_nodes = google_container_cluster.primary.private_cluster_config[0].master_ipv4_cidr_block
150+ cluster_endpoint_for_nodes = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (
151+ var.private_endpoint_subnetwork != null ?
152+ data.google_compute_subnetwork.private_endpoint_subnetwork[0].ip_cidr_range :
153+ var.master_ipv4_cidr_block != null ?
154+ google_container_cluster.primary.private_cluster_config[0].master_ipv4_cidr_block :
155+ local.cluster_subnet_cidr
156+ ) : local.cluster_subnet_cidr
151157{% else %}
152158 cluster_endpoint = google_container_cluster.primary.endpoint
153159 cluster_endpoint_for_nodes = "${google_container_cluster.primary.endpoint}/32"
Original file line number Diff line number Diff line change @@ -24,3 +24,14 @@ data "google_compute_subnetwork" "gke_subnetwork" {
2424 region = local.region
2525 project = local.network_project_id
2626}
27+
28+ {% if private_cluster %}
29+ data "google_compute_subnetwork" "private_endpoint_subnetwork" {
30+ provider = google
31+
32+ count = var.private_endpoint_subnetwork != null ? 1 : 0
33+ name = var.private_endpoint_subnetwork
34+ region = local.region
35+ project = local.network_project_id
36+ }
37+ {% endif %}
Original file line number Diff line number Diff line change @@ -76,9 +76,15 @@ locals {
7676 cluster_output_regional_zones = google_container_cluster. primary . node_locations
7777 cluster_output_zones = local. cluster_output_regional_zones
7878
79- cluster_endpoint = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (var. enable_private_endpoint || var. deploy_using_private_endpoint ? google_container_cluster. primary . private_cluster_config [0 ]. private_endpoint : google_container_cluster. primary . private_cluster_config [0 ]. public_endpoint ) : google_container_cluster. primary . endpoint
80- cluster_peering_name = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? google_container_cluster. primary . private_cluster_config [0 ]. peering_name : null
81- cluster_endpoint_for_nodes = google_container_cluster. primary . private_cluster_config [0 ]. master_ipv4_cidr_block
79+ cluster_endpoint = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (var. enable_private_endpoint || var. deploy_using_private_endpoint ? google_container_cluster. primary . private_cluster_config [0 ]. private_endpoint : google_container_cluster. primary . private_cluster_config [0 ]. public_endpoint ) : google_container_cluster. primary . endpoint
80+ cluster_peering_name = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? google_container_cluster. primary . private_cluster_config [0 ]. peering_name : null
81+ cluster_endpoint_for_nodes = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (
82+ var. private_endpoint_subnetwork != null ?
83+ data. google_compute_subnetwork . private_endpoint_subnetwork [0 ]. ip_cidr_range :
84+ var. master_ipv4_cidr_block != null ?
85+ google_container_cluster. primary . private_cluster_config [0 ]. master_ipv4_cidr_block :
86+ local. cluster_subnet_cidr
87+ ) : local. cluster_subnet_cidr
8288
8389 cluster_output_master_auth = concat (google_container_cluster. primary [* ]. master_auth , [])
8490 cluster_output_master_version = google_container_cluster. primary . master_version
Original file line number Diff line number Diff line change @@ -24,3 +24,12 @@ data "google_compute_subnetwork" "gke_subnetwork" {
2424 region = local. region
2525 project = local. network_project_id
2626}
27+
28+ data "google_compute_subnetwork" "private_endpoint_subnetwork" {
29+ provider = google
30+
31+ count = var. private_endpoint_subnetwork != null ? 1 : 0
32+ name = var. private_endpoint_subnetwork
33+ region = local. region
34+ project = local. network_project_id
35+ }
Original file line number Diff line number Diff line change @@ -24,3 +24,4 @@ data "google_compute_subnetwork" "gke_subnetwork" {
2424 region = local. region
2525 project = local. network_project_id
2626}
27+
Original file line number Diff line number Diff line change @@ -122,9 +122,15 @@ locals {
122122 cluster_output_regional_zones = google_container_cluster. primary . node_locations
123123 cluster_output_zones = local. cluster_output_regional_zones
124124
125- cluster_endpoint = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (var. enable_private_endpoint || var. deploy_using_private_endpoint ? google_container_cluster. primary . private_cluster_config [0 ]. private_endpoint : google_container_cluster. primary . private_cluster_config [0 ]. public_endpoint ) : google_container_cluster. primary . endpoint
126- cluster_peering_name = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? google_container_cluster. primary . private_cluster_config [0 ]. peering_name : null
127- cluster_endpoint_for_nodes = google_container_cluster. primary . private_cluster_config [0 ]. master_ipv4_cidr_block
125+ cluster_endpoint = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (var. enable_private_endpoint || var. deploy_using_private_endpoint ? google_container_cluster. primary . private_cluster_config [0 ]. private_endpoint : google_container_cluster. primary . private_cluster_config [0 ]. public_endpoint ) : google_container_cluster. primary . endpoint
126+ cluster_peering_name = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? google_container_cluster. primary . private_cluster_config [0 ]. peering_name : null
127+ cluster_endpoint_for_nodes = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (
128+ var. private_endpoint_subnetwork != null ?
129+ data. google_compute_subnetwork . private_endpoint_subnetwork [0 ]. ip_cidr_range :
130+ var. master_ipv4_cidr_block != null ?
131+ google_container_cluster. primary . private_cluster_config [0 ]. master_ipv4_cidr_block :
132+ local. cluster_subnet_cidr
133+ ) : local. cluster_subnet_cidr
128134
129135 cluster_output_master_auth = concat (google_container_cluster. primary [* ]. master_auth , [])
130136 cluster_output_master_version = google_container_cluster. primary . master_version
Original file line number Diff line number Diff line change @@ -24,3 +24,12 @@ data "google_compute_subnetwork" "gke_subnetwork" {
2424 region = local. region
2525 project = local. network_project_id
2626}
27+
28+ data "google_compute_subnetwork" "private_endpoint_subnetwork" {
29+ provider = google
30+
31+ count = var. private_endpoint_subnetwork != null ? 1 : 0
32+ name = var. private_endpoint_subnetwork
33+ region = local. region
34+ project = local. network_project_id
35+ }
Original file line number Diff line number Diff line change @@ -122,9 +122,15 @@ locals {
122122 cluster_output_regional_zones = google_container_cluster. primary . node_locations
123123 cluster_output_zones = local. cluster_output_regional_zones
124124
125- cluster_endpoint = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (var. enable_private_endpoint || var. deploy_using_private_endpoint ? google_container_cluster. primary . private_cluster_config [0 ]. private_endpoint : google_container_cluster. primary . private_cluster_config [0 ]. public_endpoint ) : google_container_cluster. primary . endpoint
126- cluster_peering_name = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? google_container_cluster. primary . private_cluster_config [0 ]. peering_name : null
127- cluster_endpoint_for_nodes = google_container_cluster. primary . private_cluster_config [0 ]. master_ipv4_cidr_block
125+ cluster_endpoint = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (var. enable_private_endpoint || var. deploy_using_private_endpoint ? google_container_cluster. primary . private_cluster_config [0 ]. private_endpoint : google_container_cluster. primary . private_cluster_config [0 ]. public_endpoint ) : google_container_cluster. primary . endpoint
126+ cluster_peering_name = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? google_container_cluster. primary . private_cluster_config [0 ]. peering_name : null
127+ cluster_endpoint_for_nodes = (var. enable_private_nodes && length (google_container_cluster. primary . private_cluster_config ) > 0 ) ? (
128+ var. private_endpoint_subnetwork != null ?
129+ data. google_compute_subnetwork . private_endpoint_subnetwork [0 ]. ip_cidr_range :
130+ var. master_ipv4_cidr_block != null ?
131+ google_container_cluster. primary . private_cluster_config [0 ]. master_ipv4_cidr_block :
132+ local. cluster_subnet_cidr
133+ ) : local. cluster_subnet_cidr
128134
129135 cluster_output_master_auth = concat (google_container_cluster. primary [* ]. master_auth , [])
130136 cluster_output_master_version = google_container_cluster. primary . master_version
Original file line number Diff line number Diff line change @@ -24,3 +24,12 @@ data "google_compute_subnetwork" "gke_subnetwork" {
2424 region = local. region
2525 project = local. network_project_id
2626}
27+
28+ data "google_compute_subnetwork" "private_endpoint_subnetwork" {
29+ provider = google
30+
31+ count = var. private_endpoint_subnetwork != null ? 1 : 0
32+ name = var. private_endpoint_subnetwork
33+ region = local. region
34+ project = local. network_project_id
35+ }
Original file line number Diff line number Diff line change @@ -24,3 +24,4 @@ data "google_compute_subnetwork" "gke_subnetwork" {
2424 region = local. region
2525 project = local. network_project_id
2626}
27+
You can’t perform that action at this time.
0 commit comments