Skip to content

Commit c9c63c4

Browse files
committed
fix: expose global master access in GA modules
1 parent a824e49 commit c9c63c4

File tree

14 files changed

+40
-12
lines changed

14 files changed

+40
-12
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,12 @@ resource "google_container_cluster" "primary" {
434434
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
435435
enable_private_nodes = private_cluster_config.value.enable_private_nodes
436436
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
437-
{% if beta_cluster %}
438437
dynamic "master_global_access_config" {
439438
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
440439
content {
441440
enabled = master_global_access_config.value
442441
}
443442
}
444-
{% endif %}
445443
}
446444
}
447445
{% endif %}

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,16 +410,18 @@ variable "master_ipv4_cidr_block" {
410410
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
411411
default = "10.0.0.0/28"
412412
}
413-
{% if beta_cluster %}
414413

415414
variable "master_global_access_enabled" {
416415
type = bool
417-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
418-
416+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
417+
418+
{% if beta_cluster %}
419419
default = true
420+
{% else %}
421+
default = false
422+
{% endif %}
420423
}
421424
{% endif %}
422-
{% endif %}
423425

424426
variable "dns_cache" {
425427
type = bool

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Then perform the following commands on the root folder:
108108
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
109109
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
110110
| 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 |
111-
| 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 |
111+
| 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` | `true` | no |
112112
| 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 |
113113
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
114114
| 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ variable "master_ipv4_cidr_block" {
295295

296296
variable "master_global_access_enabled" {
297297
type = bool
298-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
298+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
299299

300300
default = true
301301
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Then perform the following commands on the root folder:
224224
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
225225
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
226226
| 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 |
227-
| 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 |
227+
| 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` | `true` | no |
228228
| 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 |
229229
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
230230
| 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ variable "master_ipv4_cidr_block" {
398398

399399
variable "master_global_access_enabled" {
400400
type = bool
401-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
401+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
402402

403403
default = true
404404
}

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +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 | (Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | 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` | `true` | no |
206206
| 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 |
207207
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
208208
| 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ variable "master_ipv4_cidr_block" {
398398

399399
variable "master_global_access_enabled" {
400400
type = bool
401-
description = "(Beta) Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
401+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
402402

403403
default = true
404404
}

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
@@ -274,6 +274,12 @@ resource "google_container_cluster" "primary" {
274274
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
275275
enable_private_nodes = private_cluster_config.value.enable_private_nodes
276276
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
277+
dynamic "master_global_access_config" {
278+
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
279+
content {
280+
enabled = master_global_access_config.value
281+
}
282+
}
277283
}
278284
}
279285

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ variable "master_ipv4_cidr_block" {
372372
default = "10.0.0.0/28"
373373
}
374374

375+
variable "master_global_access_enabled" {
376+
type = bool
377+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
378+
379+
default = false
380+
}
381+
375382
variable "dns_cache" {
376383
type = bool
377384
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
@@ -274,6 +274,12 @@ resource "google_container_cluster" "primary" {
274274
enable_private_endpoint = private_cluster_config.value.enable_private_endpoint
275275
enable_private_nodes = private_cluster_config.value.enable_private_nodes
276276
master_ipv4_cidr_block = private_cluster_config.value.master_ipv4_cidr_block
277+
dynamic "master_global_access_config" {
278+
for_each = var.master_global_access_enabled ? [var.master_global_access_enabled] : []
279+
content {
280+
enabled = master_global_access_config.value
281+
}
282+
}
277283
}
278284
}
279285

modules/private-cluster/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ variable "master_ipv4_cidr_block" {
372372
default = "10.0.0.0/28"
373373
}
374374

375+
variable "master_global_access_enabled" {
376+
type = bool
377+
description = "Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint."
378+
379+
default = false
380+
}
381+
375382
variable "dns_cache" {
376383
type = bool
377384
description = "The status of the NodeLocal DNSCache addon."

0 commit comments

Comments
 (0)