Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_container_cluster: with enable_autopilot does not allow configuring gcp_filestore_csi_driver_config #17215

Closed
terlar opened this issue Feb 7, 2024 · 8 comments · Fixed by GoogleCloudPlatform/magic-modules#11748, hashicorp/terraform-provider-google-beta#8260 or #19590

Comments

@terlar
Copy link

terlar commented Feb 7, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally
    to expedite investigation and resolution of this issue.

Terraform Version

v1.6.0

Affected Resource(s)

google_container_cluster

Terraform Configuration

resource "google_container_cluster" "autopilot" {
  provider = google-beta

  # ... rest of mandatory fields

  enable_autopilot = true
  addons_config {
    gcp_filestore_csi_driver_config {
      enabled = false
    }
  }
}

or

resource "google_container_cluster" "autopilot" {
  provider = google-beta

  # ... rest of mandatory fields

  enable_autopilot = true
  addons_config {
    gcp_filestore_csi_driver_config {
      enabled = true
    }
  }
}

Debug Output

No response

Expected Behavior

It should allow disabling or setting the gcp_filestore_csi_driver_config. Just like you can do via a cluster update via the CLI and/or the interface:

gcloud container clusters update CLUSTER_NAME --update-addons=GcpFilestoreCsiDriver=DISABLED

image

Right now I have to work around this via terraform-google-modules/gcloud/google and the update takes 30 minutes+ while the creation of the cluster just takes 8 minutes.

Actual Behavior

"addons_config.0.gcp_filestore_csi_driver_config": conflicts with enable_autopilot

Is this due to creation of clusters not allowing doing this? But updates allow it.

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

b/324558621

@terlar terlar added the bug label Feb 7, 2024
@github-actions github-actions bot added forward/review In review; remove label to forward service/container labels Feb 7, 2024
@edwardmedia edwardmedia self-assigned this Feb 7, 2024
@edwardmedia
Copy link
Contributor

edwardmedia commented Feb 7, 2024

@terlar the error you received appear to be that addons is not supported by the autopilot.

Take a look at the comparison for the autopilot, you might see what are supported. This behavior is dictated by the api. There is not we can do at the provider level.

Where did you see it should be as what you stated in Expected Behavior?

@terlar
Copy link
Author

terlar commented Feb 8, 2024

Thank you for the link. The addon is pre-configured, but can optionally be disabled:
https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/filestore-csi-driver#disable

I guess it is the same thing as with mesh certificates (cannot be enabled during creation). Filestore CSI driver cannot be disabled during creation.

But it is possible to disable the addon either via GCloud CLI and the Google Cloud Console.

I saw this in the linked documentation as well as in the Google Cloud Console on my own autopilot clusters (screenshot posted earlier).

I can add the addon for backup during creation, so addons is not completely off limits:

addons_config {
  gke_backup_agent_config {
    enabled = true
  }
}

@edwardmedia
Copy link
Contributor

Yes, need to bring the behavior up to the same as other tools

@edwardmedia edwardmedia removed their assignment Feb 8, 2024
@edwardmedia edwardmedia removed the forward/review In review; remove label to forward label Feb 8, 2024
@leiyiz
Copy link

leiyiz commented Feb 24, 2024

But updates allow it

were you able to use TF to disable the addon on an existing cluster? On create time it's not possible to turn it off.

@sunnylovestiramisu
Copy link

This is an intended behavior in AP cluster, gcp_filestore_csi_driver_config will always be enabled.

We only allow customers to turn it on or off for standard clusters.

@terlar
Copy link
Author

terlar commented Mar 8, 2024

As you can see from my screenshot and earlier message that is not true. I do have autopilot clusters and I can disable filestore CSI driver both via gcloud and Google Cloud Console after cluster creation.

Whether this ability is a bug or feature I leave up to you.

@leiyiz Yes, by using the gcloud module and have it depend on the cluster resource. It is not possible via the google_container_cluster resource as it explicitly don't allow it.

@philipsabri
Copy link

philipsabri commented Sep 17, 2024

This is an intended behavior in AP cluster, gcp_filestore_csi_driver_config will always be enabled.

We only allow customers to turn it on or off for standard clusters.

@sunnylovestiramisu @leiyiz

It is allowed to create an Autopilot cluster directly through the API with gcpFilestoreCsiDriverConfig set to disabled.

image

Request body
{
  "projectId": "x",
  "cluster": {
    "addonsConfig": {
      "gcpFilestoreCsiDriverConfig": {
        "enabled": false
      }
    },
    "name": "fromapi",
    "autopilot": {
      "enabled": true
    }
  }
}

image
image

There is also google documentation confirming that you can disable it, although it is not recommended.

Allowing this configuration for Autopilot clusters would save time when creating new clusters, especially since it's permitted through the API:

    gcp_filestore_csi_driver_config {
      enabled = false
    }

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.