Skip to content

Commit eff8ef7

Browse files
GKE Parallelstore CSI Driver Terraform Integration (#12147) (#8607)
[upstream:2c0d6eb23d5c498c9611412b038df5628e64d1db] Signed-off-by: Modular Magician <[email protected]>
1 parent 9796692 commit eff8ef7

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

.changelog/12147.txt

+3
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-beta/services/container/resource_container_cluster.go

+32
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
"addons_config.0.istio_config",
9293
"addons_config.0.kalm_config",
9394
}
@@ -431,6 +432,22 @@ func ResourceContainerCluster() *schema.Resource {
431432
},
432433
},
433434
},
435+
"parallelstore_csi_driver_config": {
436+
Type: schema.TypeList,
437+
Optional: true,
438+
Computed: true,
439+
AtLeastOneOf: addonsConfigKeys,
440+
MaxItems: 1,
441+
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.`,
442+
Elem: &schema.Resource{
443+
Schema: map[string]*schema.Schema{
444+
"enabled": {
445+
Type: schema.TypeBool,
446+
Required: true,
447+
},
448+
},
449+
},
450+
},
434451
"istio_config": {
435452
Type: schema.TypeList,
436453
Optional: true,
@@ -4698,6 +4715,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
46984715
}
46994716
}
47004717

4718+
if v, ok := config["parallelstore_csi_driver_config"]; ok && len(v.([]interface{})) > 0 {
4719+
addon := v.([]interface{})[0].(map[string]interface{})
4720+
ac.ParallelstoreCsiDriverConfig = &container.ParallelstoreCsiDriverConfig{
4721+
Enabled: addon["enabled"].(bool),
4722+
ForceSendFields: []string{"Enabled"},
4723+
}
4724+
}
4725+
47014726
if v, ok := config["istio_config"]; ok && len(v.([]interface{})) > 0 {
47024727
addon := v.([]interface{})[0].(map[string]interface{})
47034728
ac.IstioConfig = &container.IstioConfig{
@@ -5921,6 +5946,13 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac
59215946
}}
59225947
}
59235948
}
5949+
if c.ParallelstoreCsiDriverConfig != nil {
5950+
result["parallelstore_csi_driver_config"] = []map[string]interface{}{
5951+
{
5952+
"enabled": c.ParallelstoreCsiDriverConfig.Enabled,
5953+
},
5954+
}
5955+
}
59245956

59255957
if c.IstioConfig != nil {
59265958
result["istio_config"] = []map[string]interface{}{

google-beta/services/container/resource_container_cluster_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -6083,6 +6083,9 @@ resource "google_container_cluster" "primary" {
60836083
}
60846084
ray_operator_config {
60856085
enabled = false
6086+
}
6087+
parallelstore_csi_driver_config {
6088+
enabled = false
60866089
}
60876090
istio_config {
60886091
disabled = true
@@ -6161,6 +6164,9 @@ resource "google_container_cluster" "primary" {
61616164
ray_cluster_monitoring_config {
61626165
enabled = true
61636166
}
6167+
}
6168+
parallelstore_csi_driver_config {
6169+
enabled = true
61646170
}
61656171
istio_config {
61666172
disabled = false

website/docs/r/container_cluster.html.markdown

+5
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)