Skip to content

Commit af43bdd

Browse files
fix: make master_ipv4_cidr_block optional for autopilot (#1902)
1 parent af354af commit af43bdd

File tree

13 files changed

+16
-14
lines changed

13 files changed

+16
-14
lines changed

autogen/main/variables.tf.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,12 @@ variable "enable_private_nodes" {
441441

442442
variable "master_ipv4_cidr_block" {
443443
type = string
444-
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
444+
description = "(Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters."
445+
{% if autopilot_cluster == true%}
446+
default = null
447+
{% else %}
445448
default = "10.0.0.0/28"
449+
{% endif %}
446450
}
447451

448452
variable "master_global_access_enabled" {

examples/simple_autopilot_private/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ module "gke" {
4949
enable_vertical_pod_autoscaling = true
5050
enable_private_endpoint = true
5151
enable_private_nodes = true
52-
master_ipv4_cidr_block = "172.16.0.0/28"
5352
network_tags = [local.cluster_type]
5453
deletion_protection = false
5554

examples/simple_autopilot_private_non_default_sa/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ module "gke" {
4949
enable_vertical_pod_autoscaling = true
5050
enable_private_endpoint = true
5151
enable_private_nodes = true
52-
master_ipv4_cidr_block = "172.16.0.0/28"
5352
deletion_protection = false
5453

5554
master_authorized_networks = [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Then perform the following commands on the root folder:
117117
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
118118
| 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 |
119119
| 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 |
120-
| 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 |
120+
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `null` | no |
121121
| name | The name of the cluster (required) | `string` | n/a | yes |
122122
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |
123123
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ variable "enable_private_nodes" {
283283

284284
variable "master_ipv4_cidr_block" {
285285
type = string
286-
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
287-
default = "10.0.0.0/28"
286+
description = "(Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters."
287+
default = null
288288
}
289289

290290
variable "master_global_access_enabled" {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Then perform the following commands on the root folder:
239239
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
240240
| 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 |
241241
| 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 |
242-
| 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 |
242+
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
243243
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
244244
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
245245
| 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
@@ -423,7 +423,7 @@ variable "enable_private_nodes" {
423423

424424
variable "master_ipv4_cidr_block" {
425425
type = string
426-
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
426+
description = "(Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters."
427427
default = "10.0.0.0/28"
428428
}
429429

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Then perform the following commands on the root folder:
217217
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
218218
| 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 |
219219
| 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 |
220-
| 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 |
220+
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
221221
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
222222
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
223223
| 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
@@ -423,7 +423,7 @@ variable "enable_private_nodes" {
423423

424424
variable "master_ipv4_cidr_block" {
425425
type = string
426-
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
426+
description = "(Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters."
427427
default = "10.0.0.0/28"
428428
}
429429

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Then perform the following commands on the root folder:
222222
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
223223
| 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 |
224224
| 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 |
225-
| 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 |
225+
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
226226
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
227227
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
228228
| 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/private-cluster-update-variant/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ variable "enable_private_nodes" {
417417

418418
variable "master_ipv4_cidr_block" {
419419
type = string
420-
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
420+
description = "(Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters."
421421
default = "10.0.0.0/28"
422422
}
423423

modules/private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Then perform the following commands on the root folder:
200200
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
201201
| 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 |
202202
| 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 |
203-
| 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 |
203+
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters. | `string` | `"10.0.0.0/28"` | no |
204204
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
205205
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
206206
| 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/private-cluster/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ variable "enable_private_nodes" {
417417

418418
variable "master_ipv4_cidr_block" {
419419
type = string
420-
description = "(Beta) The IP range in CIDR notation to use for the hosted master network"
420+
description = "(Beta) The IP range in CIDR notation to use for the hosted master network. Optional for Autopilot clusters."
421421
default = "10.0.0.0/28"
422422
}
423423

0 commit comments

Comments
 (0)