Skip to content

Commit 0f3813c

Browse files
GKE Parallelstore CSI Driver Terraform Integration (#12147) (#20163)
[upstream:2c0d6eb23d5c498c9611412b038df5628e64d1db] Signed-off-by: Modular Magician <[email protected]>
1 parent 803b5f5 commit 0f3813c

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

.changelog/12147.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
container: added `parallelstore_csi_driver_config` field to `google_container_cluster` resource.
3+
```

google/services/container/resource_container_cluster.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ var (
8888
"addons_config.0.gcs_fuse_csi_driver_config",
8989
"addons_config.0.stateful_ha_config",
9090
"addons_config.0.ray_operator_config",
91+
"addons_config.0.parallelstore_csi_driver_config",
9192
}
9293

9394
privateClusterConfigKeys = []string{
@@ -428,6 +429,22 @@ func ResourceContainerCluster() *schema.Resource {
428429
},
429430
},
430431
},
432+
"parallelstore_csi_driver_config": {
433+
Type: schema.TypeList,
434+
Optional: true,
435+
Computed: true,
436+
AtLeastOneOf: addonsConfigKeys,
437+
MaxItems: 1,
438+
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.`,
439+
Elem: &schema.Resource{
440+
Schema: map[string]*schema.Schema{
441+
"enabled": {
442+
Type: schema.TypeBool,
443+
Required: true,
444+
},
445+
},
446+
},
447+
},
431448
"config_connector_config": {
432449
Type: schema.TypeList,
433450
Optional: true,
@@ -4388,6 +4405,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
43884405
}
43894406
}
43904407

4408+
if v, ok := config["parallelstore_csi_driver_config"]; ok && len(v.([]interface{})) > 0 {
4409+
addon := v.([]interface{})[0].(map[string]interface{})
4410+
ac.ParallelstoreCsiDriverConfig = &container.ParallelstoreCsiDriverConfig{
4411+
Enabled: addon["enabled"].(bool),
4412+
ForceSendFields: []string{"Enabled"},
4413+
}
4414+
}
4415+
43914416
return ac
43924417
}
43934418

@@ -5494,6 +5519,13 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac
54945519
}}
54955520
}
54965521
}
5522+
if c.ParallelstoreCsiDriverConfig != nil {
5523+
result["parallelstore_csi_driver_config"] = []map[string]interface{}{
5524+
{
5525+
"enabled": c.ParallelstoreCsiDriverConfig.Enabled,
5526+
},
5527+
}
5528+
}
54975529

54985530
return []map[string]interface{}{result}
54995531
}

google/services/container/resource_container_cluster_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5579,6 +5579,9 @@ resource "google_container_cluster" "primary" {
55795579
}
55805580
ray_operator_config {
55815581
enabled = false
5582+
}
5583+
parallelstore_csi_driver_config {
5584+
enabled = false
55825585
}
55835586
}
55845587
network = "%s"
@@ -5650,6 +5653,9 @@ resource "google_container_cluster" "primary" {
56505653
ray_cluster_monitoring_config {
56515654
enabled = true
56525655
}
5656+
}
5657+
parallelstore_csi_driver_config {
5658+
enabled = true
56535659
}
56545660
}
56555661
network = "%s"

website/docs/r/container_cluster.html.markdown

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,11 @@ Fleet configuration for the cluster. Structure is [documented below](#nested_fle
481481
GKE](https://cloud.google.com/kubernetes-engine/docs/add-on/ray-on-gke/how-to/collect-view-logs-metrics)
482482
for more information.
483483

484+
* `parallelstore_csi_driver_config` - (Optional) The status of the Parallelstore CSI driver addon,
485+
which allows the usage of a Parallelstore instances as volumes.
486+
It is disabled by default for Standard clusters; set `enabled = true` to enable.
487+
It is enabled by default for Autopilot clusters with version 1.29 or later; set `enabled = true` to enable it explicitly.
488+
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.
484489

485490
This example `addons_config` disables two addons:
486491

0 commit comments

Comments
 (0)