Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var (
{{- if ne $.TargetVersionName "ga" }}
"addons_config.0.istio_config",
"addons_config.0.kalm_config",
"addons_config.0.pod_snapshot_config",
{{- end }}
}

Expand Down Expand Up @@ -557,6 +558,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.`,
},
},
},
},
{{- end }}
"config_connector_config": {
Type: schema.TypeList,
Expand Down Expand Up @@ -5630,6 +5648,14 @@ func expandClusterAddonsConfig(configured interface{}) *container.AddonsConfig {
ForceSendFields: []string{"Enabled"},
}
}

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"},
}
}
{{- end }}

return ac
Expand Down Expand Up @@ -7233,6 +7259,14 @@ func flattenClusterAddonsConfig(c *container.AddonsConfig) []map[string]interfac
},
}
}

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

return []map[string]interface{}{result}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fields:
{{- end }}
{{- if ne $.TargetVersionName "ga" }}
- api_field: 'addonsConfig.kalmConfig.enabled'
- api_field: 'addonsConfig.podSnapshotConfig.enabled'
{{- end }}
- api_field: 'addonsConfig.lustreCsiDriverConfig.enableLegacyLustrePort'
- api_field: 'addonsConfig.lustreCsiDriverConfig.enabled'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7618,6 +7618,9 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = false
}
pod_snapshot_config {
enabled = false
}
{{- end }}
}
network = "%s"
Expand Down Expand Up @@ -7700,6 +7703,9 @@ resource "google_container_cluster" "primary" {
kalm_config {
enabled = true
}
pod_snapshot_config {
enabled = true
}
{{- end }}
}
network = "%s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,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, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) 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