Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ var (
"addons_config.0.ray_operator_config",
"addons_config.0.parallelstore_csi_driver_config",
"addons_config.0.lustre_csi_driver_config",
"addons_config.0.pod_snapshot_config",
{{- if ne $.TargetVersionName "ga" }}
"addons_config.0.istio_config",
"addons_config.0.kalm_config",
Expand Down Expand Up @@ -341,6 +342,23 @@ func ResourceContainerCluster() *schema.Resource {
},
},
},
"pod_snapshot_config": {
Type: schema.TypeList,
Optional: true,
Computed: true,
AtLeastOneOf: addonsConfigKeys,
MaxItems: 1,
Description: `Configuration for the Pod Snapshot feature.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Required: true,
Description: `Whether the Pod Snapshot feature is enabled for this cluster.`,
},
},
},
},
"horizontal_pod_autoscaling": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -5489,6 +5507,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
}
}

if v, ok := config["pod_snapshot_config"]; ok && len(v.([]interface{})) > 0 {
addon := v.([]interface{})[0].(map[string]interface{})
ac.PodSnapshotConfig = &container.PodSnapshotConfig{
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 @@ -7008,6 +7034,14 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac
}
}

if c.PodSnapshotConfig != nil {
result["pod_snapshot_config"] = []map[string]interface{}{
{
"enabled": c.PodSnapshotConfig.Enabled,
},
}
}

{{ if ne $.TargetVersionName `ga` -}}
if c.IstioConfig != nil {
result["istio_config"] = []map[string]interface{}{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7109,6 +7109,9 @@ resource "google_container_cluster" "primary" {
lustre_csi_driver_config {
enabled = false
}
pod_snapshot_config {
enabled = false
}
{{- if ne $.TargetVersionName "ga" }}
istio_config {
disabled = true
Expand Down Expand Up @@ -7191,6 +7194,9 @@ resource "google_container_cluster" "primary" {
enabled = true
enable_legacy_lustre_port=true
}
pod_snapshot_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 @@ -524,6 +524,8 @@ Fleet configuration for the cluster. Structure is [documented below](#nested_fle
This flag is required to workaround a port conflict with the gke-metadata-server on GKE nodes.
See [Enable Lustre CSI driver](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/lustre-csi-driver-new-volume) for more information.

* `pod_snapshot_config` - (Optional) The status of the Pod Snapshot addon. It is disabled by default. Set `enabled = true` to enable.

This example `addons_config` disables two addons:

```hcl
Expand Down
Loading