Skip to content

Commit

Permalink
GKE Parallelstore CSI Driver Terraform Integration (GoogleCloudPlatfo…
Browse files Browse the repository at this point in the history
  • Loading branch information
uriel-guzman authored and BBBmau committed Nov 5, 2024
1 parent c0bc72c commit 57072ed
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,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",
{{- if ne $.TargetVersionName "ga" }}
"addons_config.0.istio_config",
"addons_config.0.kalm_config",
Expand Down Expand Up @@ -437,6 +438,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,
},
},
},
},
{{- if ne $.TargetVersionName "ga" }}
"istio_config": {
Type: schema.TypeList,
Expand Down Expand Up @@ -4758,6 +4775,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"},
}
}

{{ if ne $.TargetVersionName `ga` -}}
if v, ok := config["istio_config"]; ok && len(v.([]interface{})) > 0 {
addon := v.([]interface{})[0].(map[string]interface{})
Expand Down Expand Up @@ -5993,6 +6018,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,
},
}
}

{{ if ne $.TargetVersionName `ga` -}}
if c.IstioConfig != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6111,6 +6111,9 @@ resource "google_container_cluster" "primary" {
ray_operator_config {
enabled = false
}
parallelstore_csi_driver_config {
enabled = false
}
{{- if ne $.TargetVersionName "ga" }}
istio_config {
disabled = true
Expand Down Expand Up @@ -6191,6 +6194,9 @@ resource "google_container_cluster" "primary" {
enabled = true
}
}
parallelstore_csi_driver_config {
enabled = true
}
{{- if ne $.TargetVersionName "ga" }}
istio_config {
disabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 57072ed

Please sign in to comment.