Skip to content

Commit

Permalink
Merge pull request #349 from vmware/fix/docs
Browse files Browse the repository at this point in the history
Fix/Docs
  • Loading branch information
ramya-bangera authored Dec 1, 2023
2 parents 26c840e + 4457ae3 commit 1f04cf2
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 69 deletions.
12 changes: 8 additions & 4 deletions docs/guides/tanzu-mission-control_tanzu_kubernetes_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: |-

# Tanzu Kubernetes Cluster (Class-based Cluster)

The `tanzu-mission-control_tanzu_kubernetes_cluster` resource enables you provision TKGM and TKGS cluster with the new API.
The `tanzu-mission-control_tanzu_kubernetes_cluster` resource enables you provision cluster class based clusters on Tanzu Kubernetes Grid Vsphere and Tanzu Kubernetes Grid Service cluster.
For an example usage of the new API resource please refer to [Tanzu Kubernetes Cluster Resource (Class-based Cluster)][Tanzu-Kubernetes-Cluster-Resource-(Class-based Cluster)].

[Tanzu-Kubernetes-Cluster-Resource-(Class-based Cluster)]: https://registry.terraform.io/providers/vmware/tanzu-mission-control/latest/docs/resources/tanzu_kubernetes_cluster
Expand All @@ -15,17 +15,21 @@ For an example usage of the new API resource please refer to [Tanzu Kubernetes C

Before creating a Tanzu Kubernetes Grid Service workload cluster in vSphere with Tanzu using this Terraform provider we need the following prerequisites.

- Register the Tanzu Kubernetes Grid Service management cluster in Tanzu Mission Control.
- Register the Tanzu Kubernetes Grid Service 2.x management cluster in Tanzu Mission Control.
Note that the Tanzu Kubernetes Grid Service management cluster must be **ready** and **healthy**.
Please refer to [registration of a Supervisor Cluster in vSphere with Tanzu.][supervisor-cluster-registration]

- Create a provisioner under the management cluster or reuse the existing providers under the management cluster. Please refer to [working with vSphere Namespaces on a Supervisor Cluster.][vSphere-namespaces]

- Ensure the CSP token used in initialising the terraform provider has the right set of permissions to create a workload cluster.

Once you have the `management cluster name` and `provisioner name` from Tanzu mission control, we are all set to provision a workload under the chosen management cluster name using the terraform script (example below).
Once you have the `management cluster name` and `provisioner name` from Tanzu mission control, we are all set to provision a workload under the chosen management cluster name using the terraform script.

If you want to manage the already existing workload, Refer to [adding a Workload Cluster into Tanzu Mission Control Management.][add-workload-cluster]
For more information about provisioning a workload, please refer to [provision a Cluster in Tanzu Kubernetes Grid Service][provision-cluster-vsphere] or [provision a Cluster in Tanzu Kubernetes Grid vSphere][provision-cluster-service]

[supervisor-cluster-registration]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-using/GUID-CC6E721E-43BF-4066-AA0A-F744280D6A03.html#GUID-CC6E721E-43BF-4066-AA0A-F744280D6A03
[vSphere-namespaces]: https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-1544C9FE-0B23-434E-B823-C59EFC2F7309.html
[add-workload-cluster]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-using/GUID-78908829-CB4E-459F-AA81-BEA415EC9A11.html
[provision-cluster-vsphere]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-using/GUID-0A1AEC6A-3E5C-424F-8EBC-1DDFC14D2688.html
[provision-cluster-vsphere]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-using/GUID-0A1AEC6A-3E5C-424F-8EBC-1DDFC14D2688.html
[provision-cluster-service]: https://docs.vmware.com/en/VMware-Tanzu-Mission-Control/services/tanzumc-using/GUID-9435CCAC-F90B-4575-9D73-D26315871C8A.html
114 changes: 65 additions & 49 deletions docs/resources/backup_schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,21 @@ resource "tanzu-mission-control_backup_schedule" "sample-full" {
}
```

## Import Backup Schedule
The resource ID for importing an existing backup schedule should be comprised of a full cluster name and a backup schedule name separated by '/'.

```bash
terraform import tanzu-mission-control_backup_schedule.demo_backup MANAGEMENT_CLUSTER_NAME/PROVISIONER_NAME/CLUSTER_NAME/BACKUP_SCHEDULE_NAME
```

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

### Required

- `name` (String) The name of the backup schedule
- `backup_scope` (String) Scope for backup schedule.
Valid values are (FULL_CLUSTER, SET_NAMESPACES, LABEL_SELECTOR)
Valid values are (FULL_CLUSTER, SET_NAMESPACES, LABEL_SELECTOR)
- `name` (String) The name of the backup schedule
- `scope` (Block List, Min: 1, Max: 1) Scope block for Back up schedule (cluster/cluster group) (see [below for nested schema](#nestedblock--scope))
- `spec` (Block List, Min: 1, Max: 1) Backup schedule spec block (see [below for nested schema](#nestedblock--spec))

Expand All @@ -214,6 +221,7 @@ resource "tanzu-mission-control_backup_schedule" "sample-full" {
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`
Expand All @@ -225,6 +233,14 @@ Required:
- `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="nestedblock--spec"></a>
### Nested Schema for `spec`
Expand Down Expand Up @@ -253,42 +269,42 @@ Optional:

- `backup_ttl` (String) The backup retention period.
- `csi_snapshot_timeout` (String) Specifies the time used to wait for CSI VolumeSnapshot status turns to ReadyToUse during creation, before returning error as timeout.
The default value is 10 minute.
Format is the time number and time sign, example: "50s" (50 seconds)
The default value is 10 minute.
Format is the time number and time sign, example: "50s" (50 seconds)
- `default_volumes_to_fs_backup` (Boolean) Specifies whether all pod volumes should be backed up via file system backup by default.
(Default: True)
(Default: True)
- `default_volumes_to_restic` (Boolean) Specifies whether restic should be used to take a backup of all pod volumes by default.
(Default: False)
(Default: False)
- `excluded_namespaces` (List of String) The namespaces to be excluded in the backup.
Can't be used if scope is SET_NAMESPACES.
Can't be used if scope is SET_NAMESPACES.
- `excluded_resources` (List of String) The name list for the resources to be excluded in backup.
- `hooks` (Block List, Max: 1) Hooks block represent custom actions that should be executed at different phases of the backup. (see [below for nested schema](#nestedblock--spec--template--hooks))
- `include_cluster_resources` (Boolean) A flag which specifies whether cluster-scoped resources should be included for consideration in the backup.
If set to true, all cluster-scoped resources will be backed up. If set to false, all cluster-scoped resources will be excluded from the backup.
If unset, all cluster-scoped resources are included if and only if all namespaces are included and there are no excluded namespaces.
Otherwise, only cluster-scoped resources associated with namespace-scoped resources included in the backup spec are backed up.
For example, if a PersistentVolumeClaim is included in the backup, its associated PersistentVolume (which is cluster-scoped) would also be backed up.
(Default: False)
If set to true, all cluster-scoped resources will be backed up. If set to false, all cluster-scoped resources will be excluded from the backup.
If unset, all cluster-scoped resources are included if and only if all namespaces are included and there are no excluded namespaces.
Otherwise, only cluster-scoped resources associated with namespace-scoped resources included in the backup spec are backed up.
For example, if a PersistentVolumeClaim is included in the backup, its associated PersistentVolume (which is cluster-scoped) would also be backed up.
(Default: False)
- `included_namespaces` (List of String) The namespace to be included for backup from.
If empty, all namespaces are included.
Can't be used if scope is FULL_CLUSTER.
Required if scope is SET_NAMESPACES.
If empty, all namespaces are included.
Can't be used if scope is FULL_CLUSTER.
Required if scope is SET_NAMESPACES.
- `included_resources` (List of String) The name list for the resources to be included into backup. If empty, all resources are included.
- `label_selector` (Block List, Max: 1) The label selector to selectively adding individual objects to the backup schedule.
If not specified, all objects are included.
Can't be used if scope is FULL_CLUSTER or SET_NAMESPACES.
Required if scope is LABEL_SELECTOR and Or Label Selectors are not defined (see [below for nested schema](#nestedblock--spec--template--label_selector))
If not specified, all objects are included.
Can't be used if scope is FULL_CLUSTER or SET_NAMESPACES.
Required if scope is LABEL_SELECTOR and Or Label Selectors are not defined (see [below for nested schema](#nestedblock--spec--template--label_selector))
- `or_label_selector` (Block List) (Repeatable Block) A list of label selectors to filter with when adding individual objects to the backup.
If multiple provided they will be joined by the OR operator.
LabelSelector as well as OrLabelSelectors cannot co-exist in backup request, only one of them can be used.
Can't be used if scope is FULL_CLUSTER or SET_NAMESPACES.
Required if scope is LABEL_SELECTOR and Label Selector is not defined (see [below for nested schema](#nestedblock--spec--template--or_label_selector))
If multiple provided they will be joined by the OR operator.
LabelSelector as well as OrLabelSelectors cannot co-exist in backup request, only one of them can be used.
Can't be used if scope is FULL_CLUSTER or SET_NAMESPACES.
Required if scope is LABEL_SELECTOR and Label Selector is not defined (see [below for nested schema](#nestedblock--spec--template--or_label_selector))
- `ordered_resources` (Map of String) Specifies the backup order of resources of specific Kind. The map key is the Kind name and value is a list of resource names separated by commas.
Each resource name has format "namespace/resourcename".
For cluster resources, simply use "resourcename".
Each resource name has format "namespace/resourcename".
For cluster resources, simply use "resourcename".
- `snapshot_volumes` (Boolean) A flag which specifies whether to take cloud snapshots of any PV's referenced in the set of objects included in the Backup.
If set to true, snapshots will be taken, otherwise, snapshots will be skipped.
If left unset, snapshots will be attempted if volume snapshots are configured for the cluster.
If set to true, snapshots will be taken, otherwise, snapshots will be skipped.
If left unset, snapshots will be attempted if volume snapshots are configured for the cluster.
- `storage_location` (String) The name of a BackupStorageLocation where the backup should be stored.
- `volume_snapshot_locations` (List of String) A list containing names of VolumeSnapshotLocations associated with this backup.

Expand All @@ -314,13 +330,13 @@ Optional:

- `excluded_namespaces` (List of String) Specifies the namespaces to which this hook spec does not apply.
- `included_namespaces` (List of String) Specifies the namespaces to which this hook spec applies.
If empty, it applies to all namespaces.
If empty, it applies to all namespaces.
- `label_selector` (Block List, Max: 1) The label selector to selectively adding individual objects to the hook resource.
If not specified, all objects are included. (see [below for nested schema](#nestedblock--spec--template--hooks--resource--label_selector))
If not specified, all objects are included. (see [below for nested schema](#nestedblock--spec--template--hooks--resource--label_selector))
- `post_hook` (Block List) (Repeatable Block) A list of backup hooks to execute after storing the item in the backup.
These are executed after all "additional items" from item actions are processed. (see [below for nested schema](#nestedblock--spec--template--hooks--resource--post_hook))
These are executed after all "additional items" from item actions are processed. (see [below for nested schema](#nestedblock--spec--template--hooks--resource--post_hook))
- `pre_hook` (Block List) (Repeatable Block) A list of backup hooks to execute after storing the item in the backup.
These are executed after all "additional items" from item actions are processed. (see [below for nested schema](#nestedblock--spec--template--hooks--resource--pre_hook))
These are executed after all "additional items" from item actions are processed. (see [below for nested schema](#nestedblock--spec--template--hooks--resource--pre_hook))

<a id="nestedblock--spec--template--hooks--resource--label_selector"></a>
### Nested Schema for `spec.template.hooks.resource.label_selector`
Expand All @@ -329,7 +345,7 @@ Optional:

- `match_expression` (Block List) (Repeatable Block) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--hooks--resource--label_selector--match_expression))
- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the map is equivalent to an element of match_expressions, whose key field is "key", the operator is "In" and the values array contains only "value".
The requirements are ANDed.
The requirements are ANDed.

<a id="nestedblock--spec--template--hooks--resource--label_selector--match_expression"></a>
### Nested Schema for `spec.template.hooks.resource.label_selector.match_expression`
Expand All @@ -338,14 +354,14 @@ Required:

- `key` (String) Key is the label key that the selector applies to.
- `operator` (String) Operator represents a key's relationship to a set of values.
Valid operators are "In", "NotIn", "Exists" and "DoesNotExist".
Valid operators are "In", "NotIn", "Exists" and "DoesNotExist".

Optional:

- `values` (List of String) Values is an array of string values.
If the operator is "In" or "NotIn", the values array must be non-empty.
If the operator is "Exists" or "DoesNotExist", the values array must be empty.
This array is replaced during a strategic merge patch.
If the operator is "In" or "NotIn", the values array must be non-empty.
If the operator is "Exists" or "DoesNotExist", the values array must be empty.
This array is replaced during a strategic merge patch.



Expand All @@ -363,12 +379,12 @@ Required:

- `command` (List of String) The command and arguments to execute.
- `container` (String) The container in the pod where the command should be executed.
If not specified, the pod's first container is used.
If not specified, the pod's first container is used.

Optional:

- `on_error` (String) Specifies how Velero should behave if it encounters an error executing this hook.
Valid values are (FAIL, CONTINUE)
Valid values are (FAIL, CONTINUE)
- `timeout` (String) Defines the maximum amount of time Velero should wait for the hook to complete before considering the execution a failure.


Expand All @@ -387,12 +403,12 @@ Required:

- `command` (List of String) The command and arguments to execute.
- `container` (String) The container in the pod where the command should be executed.
If not specified, the pod's first container is used.
If not specified, the pod's first container is used.

Optional:

- `on_error` (String) Specifies how Velero should behave if it encounters an error executing this hook.
Valid values are (FAIL, CONTINUE)
Valid values are (FAIL, CONTINUE)
- `timeout` (String) Defines the maximum amount of time Velero should wait for the hook to complete before considering the execution a failure.


Expand All @@ -406,7 +422,7 @@ Optional:

- `match_expression` (Block List) (Repeatable Block) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--label_selector--match_expression))
- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the map is equivalent to an element of match_expressions, whose key field is "key", the operator is "In" and the values array contains only "value".
The requirements are ANDed.
The requirements are ANDed.

<a id="nestedblock--spec--template--label_selector--match_expression"></a>
### Nested Schema for `spec.template.label_selector.match_expression`
Expand All @@ -415,14 +431,14 @@ Required:

- `key` (String) Key is the label key that the selector applies to.
- `operator` (String) Operator represents a key's relationship to a set of values.
Valid operators are "In", "NotIn", "Exists" and "DoesNotExist".
Valid operators are "In", "NotIn", "Exists" and "DoesNotExist".

Optional:

- `values` (List of String) Values is an array of string values.
If the operator is "In" or "NotIn", the values array must be non-empty.
If the operator is "Exists" or "DoesNotExist", the values array must be empty.
This array is replaced during a strategic merge patch.
If the operator is "In" or "NotIn", the values array must be non-empty.
If the operator is "Exists" or "DoesNotExist", the values array must be empty.
This array is replaced during a strategic merge patch.



Expand All @@ -433,7 +449,7 @@ Optional:

- `match_expression` (Block List) (Repeatable Block) A list of label selector requirements. The requirements are ANDed. (see [below for nested schema](#nestedblock--spec--template--or_label_selector--match_expression))
- `match_labels` (Map of String) A map of {key,value} pairs. A single {key,value} in the map is equivalent to an element of match_expressions, whose key field is "key", the operator is "In" and the values array contains only "value".
The requirements are ANDed.
The requirements are ANDed.

<a id="nestedblock--spec--template--or_label_selector--match_expression"></a>
### Nested Schema for `spec.template.or_label_selector.match_expression`
Expand All @@ -442,14 +458,14 @@ Required:

- `key` (String) Key is the label key that the selector applies to.
- `operator` (String) Operator represents a key's relationship to a set of values.
Valid operators are "In", "NotIn", "Exists" and "DoesNotExist".
Valid operators are "In", "NotIn", "Exists" and "DoesNotExist".

Optional:

- `values` (List of String) Values is an array of string values.
If the operator is "In" or "NotIn", the values array must be non-empty.
If the operator is "Exists" or "DoesNotExist", the values array must be empty.
This array is replaced during a strategic merge patch.
If the operator is "In" or "NotIn", the values array must be non-empty.
If the operator is "Exists" or "DoesNotExist", the values array must be empty.
This array is replaced during a strategic merge patch.



Expand Down
18 changes: 17 additions & 1 deletion docs/resources/enable_data_protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@ resource "tanzu-mission-control_enable_data_protection" "demo" {
}
```

## Import Data Protection
The resource ID for importing an existing data protection should be comprised of a full cluster name and a backup schedule name separated by '/'.

```bash
terraform import tanzu-mission-control_backup_schedule.demo_backup MANAGEMENT_CLUSTER_NAME/PROVISIONER_NAME/CLUSTER_NAME/BACKUP_SCHEDULE_NAME
```

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

### Required

- `scope` (Block List, Min: 1, Max: 1) Scope block for Data Protection (cluster) (see [below for nested schema](#nestedblock--scope))
- `scope` (Block List, Min: 1, Max: 1) Scope block for Data Protection (cluster/cluster group) (see [below for nested schema](#nestedblock--scope))

### Optional

Expand All @@ -60,6 +67,7 @@ resource "tanzu-mission-control_enable_data_protection" "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`
Expand All @@ -71,6 +79,14 @@ Required:
- `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="nestedblock--deletion_policy"></a>
### Nested Schema for `deletion_policy`
Expand Down
Loading

0 comments on commit 1f04cf2

Please sign in to comment.