diff --git a/.changelog/12147.txt b/.changelog/12147.txt new file mode 100644 index 00000000000..7b02d0ecf4d --- /dev/null +++ b/.changelog/12147.txt @@ -0,0 +1,3 @@ +```release-note:note +container: added `parallelstore_csi_driver_config` field to `google_container_cluster` resource. +``` \ No newline at end of file diff --git a/google/services/container/resource_container_cluster.go b/google/services/container/resource_container_cluster.go index be68464ba8c..ab93b765dbc 100644 --- a/google/services/container/resource_container_cluster.go +++ b/google/services/container/resource_container_cluster.go @@ -88,6 +88,7 @@ var ( "addons_config.0.gcs_fuse_csi_driver_config", "addons_config.0.stateful_ha_config", "addons_config.0.ray_operator_config", + "addons_config.0.parallelstore_csi_driver_config", } privateClusterConfigKeys = []string{ @@ -428,6 +429,22 @@ func ResourceContainerCluster() *schema.Resource { }, }, }, + "parallelstore_csi_driver_config": { + Type: schema.TypeList, + Optional: true, + Computed: true, + AtLeastOneOf: addonsConfigKeys, + MaxItems: 1, + Description: `The status of the Parallelstore CSI driver addon, which allows the usage of Parallelstore instances as volumes. Defaults to disabled; set enabled = true to enable.`, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, "config_connector_config": { Type: schema.TypeList, Optional: true, @@ -4388,6 +4405,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig { } } + if v, ok := config["parallelstore_csi_driver_config"]; ok && len(v.([]interface{})) > 0 { + addon := v.([]interface{})[0].(map[string]interface{}) + ac.ParallelstoreCsiDriverConfig = &container.ParallelstoreCsiDriverConfig{ + Enabled: addon["enabled"].(bool), + ForceSendFields: []string{"Enabled"}, + } + } + return ac } @@ -5494,6 +5519,13 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac }} } } + if c.ParallelstoreCsiDriverConfig != nil { + result["parallelstore_csi_driver_config"] = []map[string]interface{}{ + { + "enabled": c.ParallelstoreCsiDriverConfig.Enabled, + }, + } + } return []map[string]interface{}{result} } diff --git a/google/services/container/resource_container_cluster_test.go b/google/services/container/resource_container_cluster_test.go index ef8bc6feb2d..6e824488c4e 100644 --- a/google/services/container/resource_container_cluster_test.go +++ b/google/services/container/resource_container_cluster_test.go @@ -5579,6 +5579,9 @@ resource "google_container_cluster" "primary" { } ray_operator_config { enabled = false + } + parallelstore_csi_driver_config { + enabled = false } } network = "%s" @@ -5650,6 +5653,9 @@ resource "google_container_cluster" "primary" { ray_cluster_monitoring_config { enabled = true } + } + parallelstore_csi_driver_config { + enabled = true } } network = "%s" diff --git a/website/docs/r/container_cluster.html.markdown b/website/docs/r/container_cluster.html.markdown index 6fb0785c876..5f1a2961a4f 100644 --- a/website/docs/r/container_cluster.html.markdown +++ b/website/docs/r/container_cluster.html.markdown @@ -481,6 +481,11 @@ Fleet configuration for the cluster. Structure is [documented below](#nested_fle GKE](https://cloud.google.com/kubernetes-engine/docs/add-on/ray-on-gke/how-to/collect-view-logs-metrics) for more information. +* `parallelstore_csi_driver_config` - (Optional) The status of the Parallelstore CSI driver addon, + which allows the usage of a Parallelstore instances as volumes. + It is disabled by default for Standard clusters; set `enabled = true` to enable. + It is enabled by default for Autopilot clusters with version 1.29 or later; set `enabled = true` to enable it explicitly. + See [Enable the Parallelstore CSI driver](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/parallelstore-csi-new-volume#enable) for more information. This example `addons_config` disables two addons: