Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/dataprotection clustergroup #375

Merged
merged 16 commits into from
Jan 31, 2024
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
87 changes: 81 additions & 6 deletions docs/data-sources/backup_schedule.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
---
Title: "Backup Schedule Data Source"
Description: |-
Listing backup schedules by cluster scope
Listing backup schedules
---

# Backup Schedule Data Source

This data source enables users to list existing backup schedules by cluster scope.
Listing target locations by cluster scope is supported only for clusters enabled with data protection.
This data source enables users to list existing backup schedules by cluster or cluster group scope.
Listing backup schedules by cluster or cluster group scope is supported only for clusters/cluster-groups enabled with data protection.

## Example Usage
## Cluster Backup Schedule
### Example Usage

```terraform
data "tanzu-mission-control_backup_schedule" "demo" {
name = "BACKUP_SCHEDULE_NAME"
name = "BACKUP_SCHEDULE_NAME"
scope {
cluster {
management_cluster_name = "MGMT_CLS_NAME"
Expand All @@ -28,18 +29,36 @@ data "tanzu-mission-control_backup_schedule" "demo" {
}
```

## Cluster Group Backup Schedule
### Example Usage

```terraform
data "tanzu-mission-control_backup_schedule" "demo" {
name = "BACKUP_SCHEDULE_NAME"
scope {
cluster_group {
cluster_group_name = "CG_NAME"
}
}

query = "QUERY"
sort_by = "SORT_BY"
include_total = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the backup schedule
- `scope` (Block List, Min: 1, Max: 1) Search scope block (see [below for nested schema](#nestedblock--scope))

### Optional

- `include_total_count` (Boolean) Whether to include total count of backups.
(Default: True)
- `name` (String) The name of the backup schedule
- `query` (String) Define a query for listing backups
- `sort_by` (String) Sort backups by field.

Expand All @@ -55,17 +74,29 @@ data "tanzu-mission-control_backup_schedule" "demo" {
Optional:

- `cluster` (Block List, Max: 1) Cluster scope block (see [below for nested schema](#nestedblock--scope--cluster))
- `cluster_group` (Block List, Max: 1) Cluster group scope block (see [below for nested schema](#nestedblock--scope--cluster_group))

<a id="nestedblock--scope--cluster"></a>
### Nested Schema for `scope.cluster`

Required:

- `cluster_name` (String) Cluster name

Optional:

- `management_cluster_name` (String) Management cluster name
- `provisioner_name` (String) Cluster provisioner name


<a id="nestedblock--scope--cluster_group"></a>
### Nested Schema for `scope.cluster_group`

Required:

- `cluster_group_name` (String) Cluster group name



<a id="nestedatt--schedules"></a>
### Nested Schema for `schedules`
Expand All @@ -76,6 +107,7 @@ Read-Only:
- `meta` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--meta))
- `name` (String)
- `scope` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope))
- `selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--selector))
- `spec` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec))

<a id="nestedobjatt--schedules--meta"></a>
Expand All @@ -96,6 +128,7 @@ Read-Only:
Read-Only:

- `cluster` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope--cluster))
- `cluster_group` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope--cluster_group))

<a id="nestedobjatt--schedules--scope--cluster"></a>
### Nested Schema for `schedules.scope.cluster`
Expand All @@ -107,6 +140,43 @@ Read-Only:
- `provisioner_name` (String)


<a id="nestedobjatt--schedules--scope--cluster_group"></a>
### Nested Schema for `schedules.scope.cluster_group`

Read-Only:

- `cluster_group_name` (String)



<a id="nestedobjatt--schedules--selector"></a>
### Nested Schema for `schedules.selector`

Read-Only:

- `excluded_names` (List of String)
- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--selector--label_selector))
- `names` (List of String)

<a id="nestedobjatt--schedules--selector--label_selector"></a>
### Nested Schema for `schedules.selector.label_selector`

Read-Only:

- `match_expression` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--selector--label_selector--match_expression))
- `match_labels` (Map of String)

<a id="nestedobjatt--schedules--selector--label_selector--match_expression"></a>
### Nested Schema for `schedules.selector.label_selector.match_labels`

Read-Only:

- `key` (String)
- `operator` (String)
- `values` (List of String)




<a id="nestedobjatt--schedules--spec"></a>
### Nested Schema for `schedules.spec`
Expand Down Expand Up @@ -134,15 +204,20 @@ Read-Only:
- `csi_snapshot_timeout` (String)
- `default_volumes_to_fs_backup` (Boolean)
- `default_volumes_to_restic` (Boolean)
- `excluded_cluster_scoped_resources` (List of String)
- `excluded_namespace_scoped_resources` (List of String)
- `excluded_namespaces` (List of String)
- `excluded_resources` (List of String)
- `hooks` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--hooks))
- `include_cluster_resources` (Boolean)
- `included_cluster_scoped_resources` (List of String)
- `included_namespace_scoped_resources` (List of String)
- `included_namespaces` (List of String)
- `included_resources` (List of String)
- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--label_selector))
- `or_label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--or_label_selector))
- `ordered_resources` (Map of String)
- `snapshot_move_data` (Boolean)
- `snapshot_volumes` (Boolean)
- `storage_location` (String)
- `sys_excluded_namespaces` (List of String)
Expand Down
10 changes: 8 additions & 2 deletions docs/guides/tanzu-mission-control_data_protection.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
---
Title: "Data Protection of a Tanzu Kubernetes Cluster"
Description: |-
An example of using Data Protection Feature for a Tanzu Kubernetes Cluster
An example of using Data Protection Feature for a Tanzu Kubernetes Cluster/Cluster Group
---
# Enable Data Protection

The `tanzu-mission-control_enable_data_protection` resource enables users to activate and set up data protection for a Tanzu Kubernetes Cluster.
Once enabled, users can create instant backups or schedule backups for later.

**NOTE :** To resolve cluster and cluster group data protection conflicts use the below command
``terraform refresh``

For more information regarding data protection, see [Data Protection][data-protection].

[data-protection]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-concepts/GUID-C16557BC-EB1B-4414-8E63-28AD92E0CAE5.html
Expand All @@ -26,7 +29,10 @@ For more information regarding target location, see [Target Location][target-loc

# Backup Schedule

The `tanzu-mission-control_backup_schedule` resource enables users to create and configure scheduled backups in a cluster.
The `tanzu-mission-control_backup_schedule` resource enables users to create and configure scheduled backups in a cluster/cluster-group.

NOTE : To resolve cluster and cluster group backup schedule conflicts use the below command
``terraform refresh``

Backups can be applied in 3 levels:

Expand Down
Loading
Loading