Skip to content

Commit b4c3cb5

Browse files
asagarwaleastaga
authored andcommitted
Handle conflicts b/w data protection at cluster and cluster-group level
Signed-off-by: Astha Agarwal <asagarwal@vmware.com>
1 parent 4d5af73 commit b4c3cb5

File tree

11 files changed

+294
-449
lines changed

11 files changed

+294
-449
lines changed

docs/data-sources/backup_schedule.md

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Listing backup schedules by cluster or cluster group scope is supported only for
1414

1515
```terraform
1616
data "tanzu-mission-control_backup_schedule" "demo" {
17-
name = "BACKUP_SCHEDULE_NAME"
17+
name = "BACKUP_SCHEDULE_NAME"
1818
scope {
1919
cluster {
2020
management_cluster_name = "MGMT_CLS_NAME"
@@ -34,10 +34,10 @@ data "tanzu-mission-control_backup_schedule" "demo" {
3434

3535
```terraform
3636
data "tanzu-mission-control_backup_schedule" "demo" {
37-
name = "BACKUP_SCHEDULE_NAME"
37+
name = "BACKUP_SCHEDULE_NAME"
3838
scope {
3939
cluster_group {
40-
cluster_group_name = "CG_NAME"
40+
cluster_group_name = "CG_NAME"
4141
}
4242
}
4343
@@ -52,13 +52,13 @@ data "tanzu-mission-control_backup_schedule" "demo" {
5252

5353
### Required
5454

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

5857
### Optional
5958

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

@@ -74,23 +74,28 @@ data "tanzu-mission-control_backup_schedule" "demo" {
7474
Optional:
7575

7676
- `cluster` (Block List, Max: 1) Cluster scope block (see [below for nested schema](#nestedblock--scope--cluster))
77-
- `cluster_group` (Block List, Max: 1) The schema for cluster group full name (see [below for nested schema](#nestedblock--scope--cluster_group))
77+
- `cluster_group` (Block List, Max: 1) Cluster group scope block (see [below for nested schema](#nestedblock--scope--cluster_group))
7878

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

8282
Required:
8383

8484
- `cluster_name` (String) Cluster name
85+
86+
Optional:
87+
8588
- `management_cluster_name` (String) Management cluster name
8689
- `provisioner_name` (String) Cluster provisioner name
8790

91+
8892
<a id="nestedblock--scope--cluster_group"></a>
8993
### Nested Schema for `scope.cluster_group`
9094

9195
Required:
9296

93-
- `cluster_group_name` (String) Name of the cluster group
97+
- `cluster_group_name` (String) Cluster group name
98+
9499

95100

96101
<a id="nestedatt--schedules"></a>
@@ -102,6 +107,7 @@ Read-Only:
102107
- `meta` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--meta))
103108
- `name` (String)
104109
- `scope` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope))
110+
- `selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--selector))
105111
- `spec` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec))
106112

107113
<a id="nestedobjatt--schedules--meta"></a>
@@ -122,7 +128,7 @@ Read-Only:
122128
Read-Only:
123129

124130
- `cluster` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope--cluster))
125-
- `cluster_group` (Block List, Max: 1) The schema for cluster group full name (see [below for nested schema](#nestedblock--scope--cluster_group))
131+
- `cluster_group` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--scope--cluster_group))
126132

127133
<a id="nestedobjatt--schedules--scope--cluster"></a>
128134
### Nested Schema for `schedules.scope.cluster`
@@ -133,12 +139,43 @@ Read-Only:
133139
- `management_cluster_name` (String)
134140
- `provisioner_name` (String)
135141

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

139-
Required:
143+
<a id="nestedobjatt--schedules--scope--cluster_group"></a>
144+
### Nested Schema for `schedules.scope.cluster_group`
145+
146+
Read-Only:
147+
148+
- `cluster_group_name` (String)
149+
150+
151+
152+
<a id="nestedobjatt--schedules--selector"></a>
153+
### Nested Schema for `schedules.selector`
154+
155+
Read-Only:
156+
157+
- `excluded_names` (List of String)
158+
- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--selector--label_selector))
159+
- `names` (List of String)
160+
161+
<a id="nestedobjatt--schedules--selector--label_selector"></a>
162+
### Nested Schema for `schedules.selector.label_selector`
163+
164+
Read-Only:
165+
166+
- `match_expression` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--selector--label_selector--match_expression))
167+
- `match_labels` (Map of String)
168+
169+
<a id="nestedobjatt--schedules--selector--label_selector--match_expression"></a>
170+
### Nested Schema for `schedules.selector.label_selector.match_labels`
171+
172+
Read-Only:
173+
174+
- `key` (String)
175+
- `operator` (String)
176+
- `values` (List of String)
177+
140178

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

143180

144181
<a id="nestedobjatt--schedules--spec"></a>
@@ -167,24 +204,24 @@ Read-Only:
167204
- `csi_snapshot_timeout` (String)
168205
- `default_volumes_to_fs_backup` (Boolean)
169206
- `default_volumes_to_restic` (Boolean)
207+
- `excluded_cluster_scoped_resources` (List of String)
208+
- `excluded_namespace_scoped_resources` (List of String)
170209
- `excluded_namespaces` (List of String)
171210
- `excluded_resources` (List of String)
172211
- `hooks` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--hooks))
173212
- `include_cluster_resources` (Boolean)
213+
- `included_cluster_scoped_resources` (List of String)
214+
- `included_namespace_scoped_resources` (List of String)
174215
- `included_namespaces` (List of String)
175216
- `included_resources` (List of String)
176217
- `label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--label_selector))
177218
- `or_label_selector` (List of Object) (see [below for nested schema](#nestedobjatt--schedules--spec--template--or_label_selector))
178219
- `ordered_resources` (Map of String)
220+
- `snapshot_move_data` (Boolean)
179221
- `snapshot_volumes` (Boolean)
180222
- `storage_location` (String)
181223
- `sys_excluded_namespaces` (List of String)
182224
- `volume_snapshot_locations` (List of String)
183-
- `included_cluster_scoped_resources` (List of String)
184-
- `excluded_cluster_scoped_resources` (List of String)
185-
- `included_namespace_scoped_resources` (List of String)
186-
- `excluded_namespace_scoped_resources` (List of String)
187-
- `snapshot_move_data` (Boolean)
188225

189226
<a id="nestedobjatt--schedules--spec--template--hooks"></a>
190227
### Nested Schema for `schedules.spec.template.volume_snapshot_locations`

docs/guides/tanzu-mission-control_data_protection.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
---
22
Title: "Data Protection of a Tanzu Kubernetes Cluster"
33
Description: |-
4-
An example of using Data Protection Feature for a Tanzu Kubernetes Cluster
4+
An example of using Data Protection Feature for a Tanzu Kubernetes Cluster/Cluster Group
55
---
66
# Enable Data Protection
77

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

11+
**NOTE :** To resolve cluster and cluster group data protection conflicts use the below command
12+
``terraform refresh``
13+
1114
For more information regarding data protection, see [Data Protection][data-protection].
1215

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

2730
# Backup Schedule
2831

29-
The `tanzu-mission-control_backup_schedule` resource enables users to create and configure scheduled backups in a cluster.
32+
The `tanzu-mission-control_backup_schedule` resource enables users to create and configure scheduled backups in a cluster/cluster-group.
33+
34+
NOTE : To resolve cluster and cluster group backup schedule conflicts use the below command
35+
``terraform refresh``
3036

3137
Backups can be applied in 3 levels:
3238

0 commit comments

Comments
 (0)