Skip to content

Commit a2f36c6

Browse files
committed
fix: expose global master access in GA modules
1 parent c81c2fe commit a2f36c6

File tree

14 files changed

+39
-15
lines changed

14 files changed

+39
-15
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,12 @@ resource "google_container_cluster" "primary" {
421421
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
422422
enable_private_nodes = private_cluster_config.value.enable_private_nodes
423423
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
424-
{% if beta_cluster %}
425424
dynamic "master_global_access_config" {
426425
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
427426
content {
428427
enabled = master_global_access_config.value
429428
}
430429
}
431-
{% endif %}
432430
}
433431
}
434432
{% endif %}

autogen/main/variables.tf.tmpl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,16 +397,14 @@ variable "master_ipv4_cidr_block" {
397397
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
398398
default = "10.0.0.0/28"
399399
}
400-
{% if beta_cluster %}
401400

402401
variable "master_global_access_enabled" {
403402
type = bool
404-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
403+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
405404

406-
default = true
405+
default = false
407406
}
408407
{% endif %}
409-
{% endif %}
410408

411409
variable "dns_cache" {
412410
type = bool

modules/beta-autopilot-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Then perform the following commands on the root folder:
107107
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
108108
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
109109
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
110-
| master\_global\_access\_enabled | (Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
110+
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `false` | no |
111111
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
112112
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
113113
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |

modules/beta-autopilot-private-cluster/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ variable "master_ipv4_cidr_block" {
284284

285285
variable "master_global_access_enabled" {
286286
type = bool
287-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
287+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
288288

289-
default = true
289+
default = false
290290
}
291291

292292
variable "dns_cache" {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Then perform the following commands on the root folder:
223223
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
224224
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
225225
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
226-
| master\_global\_access\_enabled | (Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
226+
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `false` | no |
227227
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
228228
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
229229
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ variable "master_ipv4_cidr_block" {
387387

388388
variable "master_global_access_enabled" {
389389
type = bool
390-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
390+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
391391

392-
default = true
392+
default = false
393393
}
394394

395395
variable "dns_cache" {

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Then perform the following commands on the root folder:
201201
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
202202
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
203203
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
204-
| master\_global\_access\_enabled | (Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
204+
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `false` | no |
205205
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
206206
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
207207
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |

modules/beta-private-cluster/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ variable "master_ipv4_cidr_block" {
387387

388388
variable "master_global_access_enabled" {
389389
type = bool
390-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
390+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
391391

392-
default = true
392+
default = false
393393
}
394394

395395
variable "dns_cache" {

modules/private-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ Then perform the following commands on the root folder:
202202
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
203203
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
204204
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
205+
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `false` | no |
205206
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
206207
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
207208
| name | The name of the cluster (required) | `string` | n/a | yes |

modules/private-cluster-update-variant/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ resource "google_container_cluster" "primary" {
267267
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
268268
enable_private_nodes = private_cluster_config.value.enable_private_nodes
269269
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
270+
dynamic "master_global_access_config" {
271+
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
272+
content {
273+
enabled = master_global_access_config.value
274+
}
275+
}
270276
}
271277
}
272278

modules/private-cluster-update-variant/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,13 @@ variable "master_ipv4_cidr_block" {
366366
default = "10.0.0.0/28"
367367
}
368368

369+
variable "master_global_access_enabled" {
370+
type = bool
371+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
372+
373+
default = false
374+
}
375+
369376
variable "dns_cache" {
370377
type = bool
371378
description = "The status of the NodeLocal DNSCache addon."

modules/private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Then perform the following commands on the root folder:
180180
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
181181
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
182182
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
183+
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `false` | no |
183184
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
184185
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
185186
| name | The name of the cluster (required) | `string` | n/a | yes |

modules/private-cluster/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ resource "google_container_cluster" "primary" {
267267
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
268268
enable_private_nodes = private_cluster_config.value.enable_private_nodes
269269
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
270+
dynamic "master_global_access_config" {
271+
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
272+
content {
273+
enabled = master_global_access_config.value
274+
}
275+
}
270276
}
271277
}
272278

modules/private-cluster/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,13 @@ variable "master_ipv4_cidr_block" {
366366
default = "10.0.0.0/28"
367367
}
368368

369+
variable "master_global_access_enabled" {
370+
type = bool
371+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
372+
373+
default = false
374+
}
375+
369376
variable "dns_cache" {
370377
type = bool
371378
description = "The status of the NodeLocal DNSCache addon."

0 commit comments

Comments
 (0)