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 {
147
147
{% if private_cluster %}
148
148
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
149
149
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
151
157
{% else %}
152
158
cluster_endpoint = google_container_cluster.primary.endpoint
153
159
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" {
24
24
region = local.region
25
25
project = local.network_project_id
26
26
}
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 {
76
76
cluster_output_regional_zones = google_container_cluster. primary . node_locations
77
77
cluster_output_zones = local. cluster_output_regional_zones
78
78
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
82
88
83
89
cluster_output_master_auth = concat (google_container_cluster. primary [* ]. master_auth , [])
84
90
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" {
24
24
region = local. region
25
25
project = local. network_project_id
26
26
}
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" {
24
24
region = local. region
25
25
project = local. network_project_id
26
26
}
27
+
Original file line number Diff line number Diff line change @@ -122,9 +122,15 @@ locals {
122
122
cluster_output_regional_zones = google_container_cluster. primary . node_locations
123
123
cluster_output_zones = local. cluster_output_regional_zones
124
124
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
128
134
129
135
cluster_output_master_auth = concat (google_container_cluster. primary [* ]. master_auth , [])
130
136
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" {
24
24
region = local. region
25
25
project = local. network_project_id
26
26
}
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 {
122
122
cluster_output_regional_zones = google_container_cluster. primary . node_locations
123
123
cluster_output_zones = local. cluster_output_regional_zones
124
124
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
128
134
129
135
cluster_output_master_auth = concat (google_container_cluster. primary [* ]. master_auth , [])
130
136
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" {
24
24
region = local. region
25
25
project = local. network_project_id
26
26
}
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" {
24
24
region = local. region
25
25
project = local. network_project_id
26
26
}
27
+
You can’t perform that action at this time.
0 commit comments