Skip to content

Commit

Permalink
Handle conflicts b/w data protection at cluster and cluster-group level
Browse files Browse the repository at this point in the history
Signed-off-by: Astha Agarwal  <asagarwal@vmware.com>
  • Loading branch information
asagarwal authored and eastaga committed Jan 31, 2024
1 parent 4d5af73 commit b4c3cb5
Show file tree
Hide file tree
Showing 11 changed files with 294 additions and 449 deletions.
69 changes: 53 additions & 16 deletions docs/data-sources/backup_schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Listing backup schedules by cluster or cluster group scope is supported only for

```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 @@ -34,10 +34,10 @@ data "tanzu-mission-control_backup_schedule" "demo" {

```terraform
data "tanzu-mission-control_backup_schedule" "demo" {
name = "BACKUP_SCHEDULE_NAME"
name = "BACKUP_SCHEDULE_NAME"
scope {
cluster_group {
cluster_group_name = "CG_NAME"
cluster_group_name = "CG_NAME"
}
}
Expand All @@ -52,13 +52,13 @@ data "tanzu-mission-control_backup_schedule" "demo" {

### 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 @@ -74,23 +74,28 @@ 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) The schema for cluster group full name (see [below for nested schema](#nestedblock--scope--cluster_group))
- `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) Name of the cluster group
- `cluster_group_name` (String) Cluster group name



<a id="nestedatt--schedules"></a>
Expand All @@ -102,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 @@ -122,7 +128,7 @@ Read-Only:
Read-Only:

- `cluster` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope--cluster))
- `cluster_group` (Block List, Max: 1) The schema for cluster group full name (see [below for nested schema](#nestedblock--scope--cluster_group))
- `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 @@ -133,12 +139,43 @@ Read-Only:
- `management_cluster_name` (String)
- `provisioner_name` (String)

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

Required:
<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)


- `cluster_group_name` (String) Name of the cluster group


<a id="nestedobjatt--schedules--spec"></a>
Expand Down Expand Up @@ -167,24 +204,24 @@ 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)
- `volume_snapshot_locations` (List of String)
- `included_cluster_scoped_resources` (List of String)
- `excluded_cluster_scoped_resources` (List of String)
- `included_namespace_scoped_resources` (List of String)
- `excluded_namespace_scoped_resources` (List of String)
- `snapshot_move_data` (Boolean)

<a id="nestedobjatt--schedules--spec--template--hooks"></a>
### Nested Schema for `schedules.spec.template.volume_snapshot_locations`
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

0 comments on commit b4c3cb5

Please sign in to comment.