Skip to content

Commit e3f016e

Browse files
authored
feat(TPG>=6.5.0)!: support gcp_filestore_csi_driver_config for autopilot (#2126)
Signed-off-by: drfaust92 <[email protected]>
1 parent ef6c1ba commit e3f016e

File tree

25 files changed

+113
-98
lines changed

25 files changed

+113
-98
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ resource "google_container_cluster" "primary" {
313313
disabled = !var.horizontal_pod_autoscaling
314314
}
315315

316+
gcp_filestore_csi_driver_config {
317+
enabled = var.filestore_csi_driver
318+
}
319+
316320
{% if autopilot_cluster != true %}
317321
network_policy_config {
318322
disabled = !var.network_policy
@@ -322,10 +326,6 @@ resource "google_container_cluster" "primary" {
322326
enabled = var.dns_cache
323327
}
324328

325-
gcp_filestore_csi_driver_config {
326-
enabled = var.filestore_csi_driver
327-
}
328-
329329
dynamic "gce_persistent_disk_csi_driver_config" {
330330
for_each = local.cluster_gce_pd_csi_config
331331

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,12 @@ variable "enable_tpu" {
696696
default = false
697697
}
698698

699+
variable "filestore_csi_driver" {
700+
type = bool
701+
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
702+
default = false
703+
}
704+
699705
{% if autopilot_cluster != true %}
700706
variable "network_policy" {
701707
type = bool
@@ -721,12 +727,6 @@ variable "remove_default_node_pool" {
721727
default = false
722728
}
723729

724-
variable "filestore_csi_driver" {
725-
type = bool
726-
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
727-
default = false
728-
}
729-
730730
variable "disable_legacy_metadata_endpoints" {
731731
type = bool
732732
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."

autogen/main/versions.tf.tmpl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ terraform {
4646
required_providers {
4747
google = {
4848
source = "hashicorp/google"
49-
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
50-
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
49+
version = ">= 6.5.0, < 7"
5150
}
5251
google-beta = {
5352
source = "hashicorp/google-beta"
54-
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
55-
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
53+
version = ">= 6.5.0, < 7"
5654
}
5755
kubernetes = {
5856
source = "hashicorp/kubernetes"
@@ -70,8 +68,7 @@ terraform {
7068
required_providers {
7169
google = {
7270
source = "hashicorp/google"
73-
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
74-
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
71+
version = ">= 6.5.0, < 7"
7572
}
7673
kubernetes = {
7774
source = "hashicorp/kubernetes"

cluster.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ resource "google_container_cluster" "primary" {
234234
disabled = !var.horizontal_pod_autoscaling
235235
}
236236

237+
gcp_filestore_csi_driver_config {
238+
enabled = var.filestore_csi_driver
239+
}
240+
237241
network_policy_config {
238242
disabled = !var.network_policy
239243
}
@@ -242,10 +246,6 @@ resource "google_container_cluster" "primary" {
242246
enabled = var.dns_cache
243247
}
244248

245-
gcp_filestore_csi_driver_config {
246-
enabled = var.filestore_csi_driver
247-
}
248-
249249
dynamic "gce_persistent_disk_csi_driver_config" {
250250
for_each = local.cluster_gce_pd_csi_config
251251

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Then perform the following commands on the root folder:
102102
| enable\_secret\_manager\_addon | (Beta) Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
103103
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
104104
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `true` | no |
105+
| 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 |
107108
| fleet\_project | (Optional) Register the cluster with the fleet in this project. | `string` | `null` | no |

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ resource "google_container_cluster" "primary" {
150150
disabled = !var.horizontal_pod_autoscaling
151151
}
152152

153+
gcp_filestore_csi_driver_config {
154+
enabled = var.filestore_csi_driver
155+
}
156+
153157

154158
dynamic "gke_backup_agent_config" {
155159
for_each = local.gke_backup_agent_config

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ variable "enable_tpu" {
454454
default = false
455455
}
456456

457+
variable "filestore_csi_driver" {
458+
type = bool
459+
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
460+
default = false
461+
}
462+
457463
variable "database_encryption" {
458464
description = "Application-layer Secrets Encryption settings. The object format is {state = string, key_name = string}. Valid values of state are: \"ENCRYPTED\"; \"DECRYPTED\". key_name is the name of a CloudKMS key."
459465
type = list(object({ state = string, key_name = string }))

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ terraform {
2020

2121
required_providers {
2222
google = {
23-
source = "hashicorp/google"
24-
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
25-
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
23+
source = "hashicorp/google"
24+
version = ">= 6.5.0, < 7"
2625
}
2726
google-beta = {
28-
source = "hashicorp/google-beta"
29-
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
30-
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
27+
source = "hashicorp/google-beta"
28+
version = ">= 6.5.0, < 7"
3129
}
3230
kubernetes = {
3331
source = "hashicorp/kubernetes"

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

Lines changed: 1 addition & 0 deletions
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 | (Beta) 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+
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
9697
| 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 |
9798
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
9899
| fleet\_project | (Optional) Register the cluster with the fleet in this project. | `string` | `null` | no |

modules/beta-autopilot-public-cluster/cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ resource "google_container_cluster" "primary" {
150150
disabled = !var.horizontal_pod_autoscaling
151151
}
152152

153+
gcp_filestore_csi_driver_config {
154+
enabled = var.filestore_csi_driver
155+
}
156+
153157

154158
dynamic "gke_backup_agent_config" {
155159
for_each = local.gke_backup_agent_config

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ variable "enable_tpu" {
418418
default = false
419419
}
420420

421+
variable "filestore_csi_driver" {
422+
type = bool
423+
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
424+
default = false
425+
}
426+
421427
variable "database_encryption" {
422428
description = "Application-layer Secrets Encryption settings. The object format is {state = string, key_name = string}. Valid values of state are: \"ENCRYPTED\"; \"DECRYPTED\". key_name is the name of a CloudKMS key."
423429
type = list(object({ state = string, key_name = string }))

modules/beta-autopilot-public-cluster/versions.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ terraform {
2020

2121
required_providers {
2222
google = {
23-
source = "hashicorp/google"
24-
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
25-
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
23+
source = "hashicorp/google"
24+
version = ">= 6.5.0, < 7"
2625
}
2726
google-beta = {
28-
source = "hashicorp/google-beta"
29-
# Workaround for https://github.com/hashicorp/terraform-provider-google/issues/19428
30-
version = ">= 5.40.0, != 5.44.0, != 6.2.0, != 6.3.0, < 7"
27+
source = "hashicorp/google-beta"
28+
version = ">= 6.5.0, < 7"
3129
}
3230
kubernetes = {
3331
source = "hashicorp/kubernetes"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
255255
disabled = !var.horizontal_pod_autoscaling
256256
}
257257

258+
gcp_filestore_csi_driver_config {
259+
enabled = var.filestore_csi_driver
260+
}
261+
258262
network_policy_config {
259263
disabled = !var.network_policy
260264
}
@@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
263267
enabled = var.dns_cache
264268
}
265269

266-
gcp_filestore_csi_driver_config {
267-
enabled = var.filestore_csi_driver
268-
}
269-
270270
dynamic "gce_persistent_disk_csi_driver_config" {
271271
for_each = local.cluster_gce_pd_csi_config
272272

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,12 @@ variable "enable_tpu" {
666666
default = false
667667
}
668668

669+
variable "filestore_csi_driver" {
670+
type = bool
671+
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
672+
default = false
673+
}
674+
669675
variable "network_policy" {
670676
type = bool
671677
description = "Enable network policy addon"
@@ -690,12 +696,6 @@ variable "remove_default_node_pool" {
690696
default = false
691697
}
692698

693-
variable "filestore_csi_driver" {
694-
type = bool
695-
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
696-
default = false
697-
}
698-
699699
variable "disable_legacy_metadata_endpoints" {
700700
type = bool
701701
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."

modules/beta-private-cluster/cluster.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
255255
disabled = !var.horizontal_pod_autoscaling
256256
}
257257

258+
gcp_filestore_csi_driver_config {
259+
enabled = var.filestore_csi_driver
260+
}
261+
258262
network_policy_config {
259263
disabled = !var.network_policy
260264
}
@@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
263267
enabled = var.dns_cache
264268
}
265269

266-
gcp_filestore_csi_driver_config {
267-
enabled = var.filestore_csi_driver
268-
}
269-
270270
dynamic "gce_persistent_disk_csi_driver_config" {
271271
for_each = local.cluster_gce_pd_csi_config
272272

modules/beta-private-cluster/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,12 @@ variable "enable_tpu" {
666666
default = false
667667
}
668668

669+
variable "filestore_csi_driver" {
670+
type = bool
671+
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
672+
default = false
673+
}
674+
669675
variable "network_policy" {
670676
type = bool
671677
description = "Enable network policy addon"
@@ -690,12 +696,6 @@ variable "remove_default_node_pool" {
690696
default = false
691697
}
692698

693-
variable "filestore_csi_driver" {
694-
type = bool
695-
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
696-
default = false
697-
}
698-
699699
variable "disable_legacy_metadata_endpoints" {
700700
type = bool
701701
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
255255
disabled = !var.horizontal_pod_autoscaling
256256
}
257257

258+
gcp_filestore_csi_driver_config {
259+
enabled = var.filestore_csi_driver
260+
}
261+
258262
network_policy_config {
259263
disabled = !var.network_policy
260264
}
@@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
263267
enabled = var.dns_cache
264268
}
265269

266-
gcp_filestore_csi_driver_config {
267-
enabled = var.filestore_csi_driver
268-
}
269-
270270
dynamic "gce_persistent_disk_csi_driver_config" {
271271
for_each = local.cluster_gce_pd_csi_config
272272

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@ variable "enable_tpu" {
630630
default = false
631631
}
632632

633+
variable "filestore_csi_driver" {
634+
type = bool
635+
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
636+
default = false
637+
}
638+
633639
variable "network_policy" {
634640
type = bool
635641
description = "Enable network policy addon"
@@ -654,12 +660,6 @@ variable "remove_default_node_pool" {
654660
default = false
655661
}
656662

657-
variable "filestore_csi_driver" {
658-
type = bool
659-
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
660-
default = false
661-
}
662-
663663
variable "disable_legacy_metadata_endpoints" {
664664
type = bool
665665
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."

modules/beta-public-cluster/cluster.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ resource "google_container_cluster" "primary" {
255255
disabled = !var.horizontal_pod_autoscaling
256256
}
257257

258+
gcp_filestore_csi_driver_config {
259+
enabled = var.filestore_csi_driver
260+
}
261+
258262
network_policy_config {
259263
disabled = !var.network_policy
260264
}
@@ -263,10 +267,6 @@ resource "google_container_cluster" "primary" {
263267
enabled = var.dns_cache
264268
}
265269

266-
gcp_filestore_csi_driver_config {
267-
enabled = var.filestore_csi_driver
268-
}
269-
270270
dynamic "gce_persistent_disk_csi_driver_config" {
271271
for_each = local.cluster_gce_pd_csi_config
272272

modules/beta-public-cluster/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,12 @@ variable "enable_tpu" {
630630
default = false
631631
}
632632

633+
variable "filestore_csi_driver" {
634+
type = bool
635+
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
636+
default = false
637+
}
638+
633639
variable "network_policy" {
634640
type = bool
635641
description = "Enable network policy addon"
@@ -654,12 +660,6 @@ variable "remove_default_node_pool" {
654660
default = false
655661
}
656662

657-
variable "filestore_csi_driver" {
658-
type = bool
659-
description = "The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes"
660-
default = false
661-
}
662-
663663
variable "disable_legacy_metadata_endpoints" {
664664
type = bool
665665
description = "Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated."

0 commit comments

Comments
 (0)