From 6f2937ee621e8675ecd2edf87bf885a163155dfd Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Mon, 16 Dec 2024 19:19:56 -0500 Subject: [PATCH 1/2] remove fuse csi driver from autopilot Signed-off-by: drfaust92 --- autogen/main/cluster.tf.tmpl | 14 +++++++------- autogen/main/main.tf.tmpl | 2 +- autogen/main/variables.tf.tmpl | 11 +++++------ cluster.tf | 12 ++++++------ main.tf | 2 +- modules/beta-autopilot-private-cluster/README.md | 1 - modules/beta-autopilot-private-cluster/cluster.tf | 8 -------- modules/beta-autopilot-private-cluster/main.tf | 7 +++---- .../beta-autopilot-private-cluster/variables.tf | 6 ------ modules/beta-autopilot-public-cluster/README.md | 1 - modules/beta-autopilot-public-cluster/cluster.tf | 8 -------- modules/beta-autopilot-public-cluster/main.tf | 7 +++---- modules/beta-autopilot-public-cluster/variables.tf | 6 ------ .../beta-private-cluster-update-variant/cluster.tf | 12 ++++++------ .../beta-private-cluster-update-variant/main.tf | 2 +- .../variables.tf | 9 ++++----- modules/beta-private-cluster/cluster.tf | 12 ++++++------ modules/beta-private-cluster/main.tf | 2 +- modules/beta-private-cluster/variables.tf | 9 ++++----- .../beta-public-cluster-update-variant/cluster.tf | 12 ++++++------ modules/beta-public-cluster-update-variant/main.tf | 2 +- .../variables.tf | 9 ++++----- modules/beta-public-cluster/cluster.tf | 12 ++++++------ modules/beta-public-cluster/main.tf | 2 +- modules/beta-public-cluster/variables.tf | 9 ++++----- modules/private-cluster-update-variant/cluster.tf | 12 ++++++------ modules/private-cluster-update-variant/main.tf | 2 +- .../private-cluster-update-variant/variables.tf | 9 ++++----- modules/private-cluster/cluster.tf | 12 ++++++------ modules/private-cluster/main.tf | 2 +- modules/private-cluster/variables.tf | 9 ++++----- variables.tf | 9 ++++----- 32 files changed, 96 insertions(+), 136 deletions(-) diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index b493d04f7c..1cc2275b91 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -346,21 +346,21 @@ resource "google_container_cluster" "primary" { config_connector_config { enabled = var.config_connector } - {% endif %} - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } + {% endif %} - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/autogen/main/main.tf.tmpl b/autogen/main/main.tf.tmpl index cc4a14817b..7ba220f38b 100644 --- a/autogen/main/main.tf.tmpl +++ b/autogen/main/main.tf.tmpl @@ -107,9 +107,9 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null + gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] {% endif %} gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] - gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false)? [var.ray_operator_config]: [] {% if beta_cluster and autopilot_cluster != true %} diff --git a/autogen/main/variables.tf.tmpl b/autogen/main/variables.tf.tmpl index 704915adf8..c7b65a48d2 100644 --- a/autogen/main/variables.tf.tmpl +++ b/autogen/main/variables.tf.tmpl @@ -815,16 +815,15 @@ variable "gce_pd_csi_driver" { default = true } -{% endif %} -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +{% endif %} +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } diff --git a/cluster.tf b/cluster.tf index d53799e500..7dd2a94e9b 100644 --- a/cluster.tf +++ b/cluster.tf @@ -268,19 +268,19 @@ resource "google_container_cluster" "primary" { enabled = var.config_connector } - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/main.tf b/main.tf index 5a3caac731..a5c03c9281 100644 --- a/main.tf +++ b/main.tf @@ -90,8 +90,8 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] diff --git a/modules/beta-autopilot-private-cluster/README.md b/modules/beta-autopilot-private-cluster/README.md index 888c450654..8785433222 100644 --- a/modules/beta-autopilot-private-cluster/README.md +++ b/modules/beta-autopilot-private-cluster/README.md @@ -108,7 +108,6 @@ Then perform the following commands on the root folder: | fleet\_project\_grant\_service\_agent | (Optional) Grant the fleet project service identity the `roles/gkehub.serviceAgent` and `roles/gkehub.crossProjectServiceAgent` roles. | `bool` | `false` | no | | gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no | | gcp\_public\_cidrs\_access\_enabled | Allow access through Google Cloud public IP addresses | `bool` | `null` | no | -| gcs\_fuse\_csi\_driver | Whether GCE FUSE CSI driver is enabled for this cluster. | `bool` | `false` | no | | gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no | | grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no | | horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no | diff --git a/modules/beta-autopilot-private-cluster/cluster.tf b/modules/beta-autopilot-private-cluster/cluster.tf index bddef25b74..9b2c8059c2 100644 --- a/modules/beta-autopilot-private-cluster/cluster.tf +++ b/modules/beta-autopilot-private-cluster/cluster.tf @@ -178,14 +178,6 @@ resource "google_container_cluster" "primary" { } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config - - content { - enabled = gcs_fuse_csi_driver_config.value.enabled - } - } - dynamic "stateful_ha_config" { for_each = local.stateful_ha_config diff --git a/modules/beta-autopilot-private-cluster/main.tf b/modules/beta-autopilot-private-cluster/main.tf index e2bd8547a3..2fa6a05453 100644 --- a/modules/beta-autopilot-private-cluster/main.tf +++ b/modules/beta-autopilot-private-cluster/main.tf @@ -64,10 +64,9 @@ locals { cluster_alias_ranges_cidr = var.add_cluster_firewall_rules ? { for range in toset(data.google_compute_subnetwork.gke_subnetwork[0].secondary_ip_range) : range.range_name => range.ip_cidr_range } : {} pod_all_ip_ranges = var.add_cluster_firewall_rules ? compact(concat([local.cluster_alias_ranges_cidr[var.ip_range_pods]], [for range in var.additional_ip_range_pods : local.cluster_alias_ranges_cidr[range] if length(range) > 0])) : [] - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] - gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] - stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] - ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] + stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] + ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{ security_group = var.authenticator_security_group diff --git a/modules/beta-autopilot-private-cluster/variables.tf b/modules/beta-autopilot-private-cluster/variables.tf index 813d42b716..1673498087 100644 --- a/modules/beta-autopilot-private-cluster/variables.tf +++ b/modules/beta-autopilot-private-cluster/variables.tf @@ -489,12 +489,6 @@ variable "gke_backup_agent_config" { default = false } -variable "gcs_fuse_csi_driver" { - type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." - default = false -} - variable "stateful_ha" { type = bool description = "Whether the Stateful HA Addon is enabled for this cluster." diff --git a/modules/beta-autopilot-public-cluster/README.md b/modules/beta-autopilot-public-cluster/README.md index 729039e281..dbbbe18efe 100644 --- a/modules/beta-autopilot-public-cluster/README.md +++ b/modules/beta-autopilot-public-cluster/README.md @@ -100,7 +100,6 @@ Then perform the following commands on the root folder: | fleet\_project\_grant\_service\_agent | (Optional) Grant the fleet project service identity the `roles/gkehub.serviceAgent` and `roles/gkehub.crossProjectServiceAgent` roles. | `bool` | `false` | no | | gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no | | gcp\_public\_cidrs\_access\_enabled | Allow access through Google Cloud public IP addresses | `bool` | `null` | no | -| gcs\_fuse\_csi\_driver | Whether GCE FUSE CSI driver is enabled for this cluster. | `bool` | `false` | no | | gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no | | grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no | | horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no | diff --git a/modules/beta-autopilot-public-cluster/cluster.tf b/modules/beta-autopilot-public-cluster/cluster.tf index 4baca3ecac..92d0eeb2f9 100644 --- a/modules/beta-autopilot-public-cluster/cluster.tf +++ b/modules/beta-autopilot-public-cluster/cluster.tf @@ -178,14 +178,6 @@ resource "google_container_cluster" "primary" { } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config - - content { - enabled = gcs_fuse_csi_driver_config.value.enabled - } - } - dynamic "stateful_ha_config" { for_each = local.stateful_ha_config diff --git a/modules/beta-autopilot-public-cluster/main.tf b/modules/beta-autopilot-public-cluster/main.tf index 5f2e7f7421..a665591fd6 100644 --- a/modules/beta-autopilot-public-cluster/main.tf +++ b/modules/beta-autopilot-public-cluster/main.tf @@ -64,10 +64,9 @@ locals { cluster_alias_ranges_cidr = var.add_cluster_firewall_rules ? { for range in toset(data.google_compute_subnetwork.gke_subnetwork[0].secondary_ip_range) : range.range_name => range.ip_cidr_range } : {} pod_all_ip_ranges = var.add_cluster_firewall_rules ? compact(concat([local.cluster_alias_ranges_cidr[var.ip_range_pods]], [for range in var.additional_ip_range_pods : local.cluster_alias_ranges_cidr[range] if length(range) > 0])) : [] - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] - gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] - stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] - ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] + stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] + ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{ security_group = var.authenticator_security_group diff --git a/modules/beta-autopilot-public-cluster/variables.tf b/modules/beta-autopilot-public-cluster/variables.tf index f212deff44..ed82dc3f09 100644 --- a/modules/beta-autopilot-public-cluster/variables.tf +++ b/modules/beta-autopilot-public-cluster/variables.tf @@ -453,12 +453,6 @@ variable "gke_backup_agent_config" { default = false } -variable "gcs_fuse_csi_driver" { - type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." - default = false -} - variable "stateful_ha" { type = bool description = "Whether the Stateful HA Addon is enabled for this cluster." diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index d4f320e369..f4129940f3 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -282,19 +282,19 @@ resource "google_container_cluster" "primary" { enabled = var.config_connector } - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/modules/beta-private-cluster-update-variant/main.tf b/modules/beta-private-cluster-update-variant/main.tf index c573681b7b..4131a493f6 100644 --- a/modules/beta-private-cluster-update-variant/main.tf +++ b/modules/beta-private-cluster-update-variant/main.tf @@ -90,8 +90,8 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? { diff --git a/modules/beta-private-cluster-update-variant/variables.tf b/modules/beta-private-cluster-update-variant/variables.tf index 8c2e2de46c..160af23f15 100644 --- a/modules/beta-private-cluster-update-variant/variables.tf +++ b/modules/beta-private-cluster-update-variant/variables.tf @@ -777,15 +777,14 @@ variable "gce_pd_csi_driver" { default = true } -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 29f11bb7ee..8a463d334e 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -282,19 +282,19 @@ resource "google_container_cluster" "primary" { enabled = var.config_connector } - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/modules/beta-private-cluster/main.tf b/modules/beta-private-cluster/main.tf index c573681b7b..4131a493f6 100644 --- a/modules/beta-private-cluster/main.tf +++ b/modules/beta-private-cluster/main.tf @@ -90,8 +90,8 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? { diff --git a/modules/beta-private-cluster/variables.tf b/modules/beta-private-cluster/variables.tf index 8c2e2de46c..160af23f15 100644 --- a/modules/beta-private-cluster/variables.tf +++ b/modules/beta-private-cluster/variables.tf @@ -777,15 +777,14 @@ variable "gce_pd_csi_driver" { default = true } -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index b20fa74835..a6a06da989 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -282,19 +282,19 @@ resource "google_container_cluster" "primary" { enabled = var.config_connector } - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/modules/beta-public-cluster-update-variant/main.tf b/modules/beta-public-cluster-update-variant/main.tf index a08408273d..a650684b74 100644 --- a/modules/beta-public-cluster-update-variant/main.tf +++ b/modules/beta-public-cluster-update-variant/main.tf @@ -90,8 +90,8 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? { diff --git a/modules/beta-public-cluster-update-variant/variables.tf b/modules/beta-public-cluster-update-variant/variables.tf index 2d5c215ddd..540e0fbad3 100644 --- a/modules/beta-public-cluster-update-variant/variables.tf +++ b/modules/beta-public-cluster-update-variant/variables.tf @@ -741,15 +741,14 @@ variable "gce_pd_csi_driver" { default = true } -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index d76574eb39..d4402dfe10 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -282,19 +282,19 @@ resource "google_container_cluster" "primary" { enabled = var.config_connector } - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/modules/beta-public-cluster/main.tf b/modules/beta-public-cluster/main.tf index a08408273d..a650684b74 100644 --- a/modules/beta-public-cluster/main.tf +++ b/modules/beta-public-cluster/main.tf @@ -90,8 +90,8 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? { diff --git a/modules/beta-public-cluster/variables.tf b/modules/beta-public-cluster/variables.tf index 2d5c215ddd..540e0fbad3 100644 --- a/modules/beta-public-cluster/variables.tf +++ b/modules/beta-public-cluster/variables.tf @@ -741,15 +741,14 @@ variable "gce_pd_csi_driver" { default = true } -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index fa03099a0c..e6490201e5 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -268,19 +268,19 @@ resource "google_container_cluster" "primary" { enabled = var.config_connector } - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/modules/private-cluster-update-variant/main.tf b/modules/private-cluster-update-variant/main.tf index dac248be86..d9e4598d9f 100644 --- a/modules/private-cluster-update-variant/main.tf +++ b/modules/private-cluster-update-variant/main.tf @@ -90,8 +90,8 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] diff --git a/modules/private-cluster-update-variant/variables.tf b/modules/private-cluster-update-variant/variables.tf index 769a67bb4f..6942315201 100644 --- a/modules/private-cluster-update-variant/variables.tf +++ b/modules/private-cluster-update-variant/variables.tf @@ -753,15 +753,14 @@ variable "gce_pd_csi_driver" { default = true } -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 3ca8117ae6..58274dc629 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -268,19 +268,19 @@ resource "google_container_cluster" "primary" { enabled = var.config_connector } - dynamic "gke_backup_agent_config" { - for_each = local.gke_backup_agent_config + dynamic "gcs_fuse_csi_driver_config" { + for_each = local.gcs_fuse_csi_driver_config content { - enabled = gke_backup_agent_config.value.enabled + enabled = gcs_fuse_csi_driver_config.value.enabled } } - dynamic "gcs_fuse_csi_driver_config" { - for_each = local.gcs_fuse_csi_driver_config + dynamic "gke_backup_agent_config" { + for_each = local.gke_backup_agent_config content { - enabled = gcs_fuse_csi_driver_config.value.enabled + enabled = gke_backup_agent_config.value.enabled } } diff --git a/modules/private-cluster/main.tf b/modules/private-cluster/main.tf index dac248be86..d9e4598d9f 100644 --- a/modules/private-cluster/main.tf +++ b/modules/private-cluster/main.tf @@ -90,8 +90,8 @@ locals { }] cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }] logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus != null - gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] gcs_fuse_csi_driver_config = var.gcs_fuse_csi_driver ? [{ enabled = true }] : [] + gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }] stateful_ha_config = var.stateful_ha ? [{ enabled = true }] : [] ray_operator_config = length(var.ray_operator_config) > 0 && lookup(var.ray_operator_config, "enabled", false) ? [var.ray_operator_config] : [] diff --git a/modules/private-cluster/variables.tf b/modules/private-cluster/variables.tf index 769a67bb4f..6942315201 100644 --- a/modules/private-cluster/variables.tf +++ b/modules/private-cluster/variables.tf @@ -753,15 +753,14 @@ variable "gce_pd_csi_driver" { default = true } -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } diff --git a/variables.tf b/variables.tf index 6b3018c7a5..dcbdb2ccd7 100644 --- a/variables.tf +++ b/variables.tf @@ -717,15 +717,14 @@ variable "gce_pd_csi_driver" { default = true } -variable "gke_backup_agent_config" { +variable "gcs_fuse_csi_driver" { type = bool - description = "Whether Backup for GKE agent is enabled for this cluster." + description = "Whether GCE FUSE CSI driver is enabled for this cluster." default = false } - -variable "gcs_fuse_csi_driver" { +variable "gke_backup_agent_config" { type = bool - description = "Whether GCE FUSE CSI driver is enabled for this cluster." + description = "Whether Backup for GKE agent is enabled for this cluster." default = false } From 2b9968660651b79429240cffa401b67c7a3fe890 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 21 Dec 2024 11:13:54 -0500 Subject: [PATCH 2/2] remove fuse csi driver from autopilot Signed-off-by: drfaust92 --- examples/simple_autopilot_public/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/simple_autopilot_public/main.tf b/examples/simple_autopilot_public/main.tf index 393b5de297..46376bbffa 100644 --- a/examples/simple_autopilot_public/main.tf +++ b/examples/simple_autopilot_public/main.tf @@ -49,7 +49,6 @@ module "gke" { network_tags = [local.cluster_type] deletion_protection = false enable_l4_ilb_subsetting = true - gcs_fuse_csi_driver = true stateful_ha = false gke_backup_agent_config = false ray_operator_config = {