Skip to content

Commit adaabbf

Browse files
authored
feat: add enterprise config (#2298)
1 parent 0e7a249 commit adaabbf

File tree

29 files changed

+139
-0
lines changed

29 files changed

+139
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Then perform the following commands on the root folder:
180180
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
181181
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
182182
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
183+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
183184
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
184185
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
185186
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: autogen/main/cluster.tf.tmpl

+7
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ resource "google_container_cluster" "primary" {
260260
}
261261
}
262262

263+
dynamic "enterprise_config" {
264+
for_each = var.enterprise_config != null ? [1] : []
265+
content {
266+
desired_tier = var.enterprise_config
267+
}
268+
}
269+
263270
enable_fqdn_network_policy = var.enable_fqdn_network_policy
264271
{% if autopilot_cluster %}
265272
enable_autopilot = true

Diff for: autogen/main/variables.tf.tmpl

+6
Original file line numberDiff line numberDiff line change
@@ -1037,3 +1037,9 @@ variable "monitoring_metric_writer_role" {
10371037
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
10381038
}
10391039
}
1040+
1041+
variable "enterprise_config" {
1042+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
1043+
type = string
1044+
default = null
1045+
}

Diff for: cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ resource "google_container_cluster" "primary" {
199199
}
200200
}
201201

202+
dynamic "enterprise_config" {
203+
for_each = var.enterprise_config != null ? [1] : []
204+
content {
205+
desired_tier = var.enterprise_config
206+
}
207+
}
208+
202209
enable_fqdn_network_policy = var.enable_fqdn_network_policy
203210
dynamic "master_authorized_networks_config" {
204211
for_each = var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []

Diff for: modules/beta-autopilot-private-cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Then perform the following commands on the root folder:
101101
| enable\_secret\_manager\_addon | Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
102102
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
103103
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `true` | no |
104+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
104105
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
105106
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
106107
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/beta-autopilot-private-cluster/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ resource "google_container_cluster" "primary" {
119119
}
120120
}
121121

122+
dynamic "enterprise_config" {
123+
for_each = var.enterprise_config != null ? [1] : []
124+
content {
125+
desired_tier = var.enterprise_config
126+
}
127+
}
128+
122129
enable_fqdn_network_policy = var.enable_fqdn_network_policy
123130
enable_autopilot = true
124131
dynamic "master_authorized_networks_config" {

Diff for: modules/beta-autopilot-private-cluster/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -607,3 +607,9 @@ variable "monitoring_metric_writer_role" {
607607
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
608608
}
609609
}
610+
611+
variable "enterprise_config" {
612+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
613+
type = string
614+
default = null
615+
}

Diff for: modules/beta-autopilot-public-cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Then perform the following commands on the root folder:
9393
| enable\_secret\_manager\_addon | Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
9494
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
9595
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `true` | no |
96+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
9697
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
9798
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
9899
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/beta-autopilot-public-cluster/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ resource "google_container_cluster" "primary" {
119119
}
120120
}
121121

122+
dynamic "enterprise_config" {
123+
for_each = var.enterprise_config != null ? [1] : []
124+
content {
125+
desired_tier = var.enterprise_config
126+
}
127+
}
128+
122129
enable_fqdn_network_policy = var.enable_fqdn_network_policy
123130
enable_autopilot = true
124131
dynamic "master_authorized_networks_config" {

Diff for: modules/beta-autopilot-public-cluster/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -571,3 +571,9 @@ variable "monitoring_metric_writer_role" {
571571
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
572572
}
573573
}
574+
575+
variable "enterprise_config" {
576+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
577+
type = string
578+
default = null
579+
}

Diff for: modules/beta-private-cluster-update-variant/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Then perform the following commands on the root folder:
217217
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
218218
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
219219
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
220+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
220221
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
221222
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
222223
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/beta-private-cluster-update-variant/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ resource "google_container_cluster" "primary" {
212212
}
213213
}
214214

215+
dynamic "enterprise_config" {
216+
for_each = var.enterprise_config != null ? [1] : []
217+
content {
218+
desired_tier = var.enterprise_config
219+
}
220+
}
221+
215222
enable_fqdn_network_policy = var.enable_fqdn_network_policy
216223
dynamic "master_authorized_networks_config" {
217224
for_each = var.enable_private_endpoint || var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []

Diff for: modules/beta-private-cluster-update-variant/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -984,3 +984,9 @@ variable "monitoring_metric_writer_role" {
984984
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
985985
}
986986
}
987+
988+
variable "enterprise_config" {
989+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
990+
type = string
991+
default = null
992+
}

Diff for: modules/beta-private-cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Then perform the following commands on the root folder:
195195
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
196196
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
197197
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
198+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
198199
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
199200
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
200201
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/beta-private-cluster/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ resource "google_container_cluster" "primary" {
212212
}
213213
}
214214

215+
dynamic "enterprise_config" {
216+
for_each = var.enterprise_config != null ? [1] : []
217+
content {
218+
desired_tier = var.enterprise_config
219+
}
220+
}
221+
215222
enable_fqdn_network_policy = var.enable_fqdn_network_policy
216223
dynamic "master_authorized_networks_config" {
217224
for_each = var.enable_private_endpoint || var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []

Diff for: modules/beta-private-cluster/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -984,3 +984,9 @@ variable "monitoring_metric_writer_role" {
984984
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
985985
}
986986
}
987+
988+
variable "enterprise_config" {
989+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
990+
type = string
991+
default = null
992+
}

Diff for: modules/beta-public-cluster-update-variant/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ Then perform the following commands on the root folder:
209209
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
210210
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
211211
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
212+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
212213
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
213214
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
214215
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/beta-public-cluster-update-variant/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ resource "google_container_cluster" "primary" {
212212
}
213213
}
214214

215+
dynamic "enterprise_config" {
216+
for_each = var.enterprise_config != null ? [1] : []
217+
content {
218+
desired_tier = var.enterprise_config
219+
}
220+
}
221+
215222
enable_fqdn_network_policy = var.enable_fqdn_network_policy
216223
dynamic "master_authorized_networks_config" {
217224
for_each = var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []

Diff for: modules/beta-public-cluster-update-variant/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -948,3 +948,9 @@ variable "monitoring_metric_writer_role" {
948948
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
949949
}
950950
}
951+
952+
variable "enterprise_config" {
953+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
954+
type = string
955+
default = null
956+
}

Diff for: modules/beta-public-cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ Then perform the following commands on the root folder:
187187
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
188188
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
189189
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
190+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
190191
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
191192
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
192193
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/beta-public-cluster/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ resource "google_container_cluster" "primary" {
212212
}
213213
}
214214

215+
dynamic "enterprise_config" {
216+
for_each = var.enterprise_config != null ? [1] : []
217+
content {
218+
desired_tier = var.enterprise_config
219+
}
220+
}
221+
215222
enable_fqdn_network_policy = var.enable_fqdn_network_policy
216223
dynamic "master_authorized_networks_config" {
217224
for_each = var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []

Diff for: modules/beta-public-cluster/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -948,3 +948,9 @@ variable "monitoring_metric_writer_role" {
948948
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
949949
}
950950
}
951+
952+
variable "enterprise_config" {
953+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
954+
type = string
955+
default = null
956+
}

Diff for: modules/private-cluster-update-variant/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Then perform the following commands on the root folder:
210210
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
211211
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
212212
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
213+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
213214
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
214215
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
215216
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/private-cluster-update-variant/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ resource "google_container_cluster" "primary" {
199199
}
200200
}
201201

202+
dynamic "enterprise_config" {
203+
for_each = var.enterprise_config != null ? [1] : []
204+
content {
205+
desired_tier = var.enterprise_config
206+
}
207+
}
208+
202209
enable_fqdn_network_policy = var.enable_fqdn_network_policy
203210
dynamic "master_authorized_networks_config" {
204211
for_each = var.enable_private_endpoint || var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []

Diff for: modules/private-cluster-update-variant/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -918,3 +918,9 @@ variable "monitoring_metric_writer_role" {
918918
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
919919
}
920920
}
921+
922+
variable "enterprise_config" {
923+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
924+
type = string
925+
default = null
926+
}

Diff for: modules/private-cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ Then perform the following commands on the root folder:
188188
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
189189
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
190190
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
191+
| enterprise\_config | (Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE. | `string` | `null` | no |
191192
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
192193
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
193194
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |

Diff for: modules/private-cluster/cluster.tf

+7
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ resource "google_container_cluster" "primary" {
199199
}
200200
}
201201

202+
dynamic "enterprise_config" {
203+
for_each = var.enterprise_config != null ? [1] : []
204+
content {
205+
desired_tier = var.enterprise_config
206+
}
207+
}
208+
202209
enable_fqdn_network_policy = var.enable_fqdn_network_policy
203210
dynamic "master_authorized_networks_config" {
204211
for_each = var.enable_private_endpoint || var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []

Diff for: modules/private-cluster/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -918,3 +918,9 @@ variable "monitoring_metric_writer_role" {
918918
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
919919
}
920920
}
921+
922+
variable "enterprise_config" {
923+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
924+
type = string
925+
default = null
926+
}

Diff for: variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -882,3 +882,9 @@ variable "monitoring_metric_writer_role" {
882882
error_message = "The monitoring_metric_writer_role must be either a predefined role (roles/*) or a custom role (projects/*/roles/*)."
883883
}
884884
}
885+
886+
variable "enterprise_config" {
887+
description = "(Optional) Enable or disable GKE enterprise. Valid values are DEFAULT and ENTERPRISE."
888+
type = string
889+
default = null
890+
}

0 commit comments

Comments
 (0)