Protect applications using Trident protect
You can protect all apps managed by Trident protect by taking snapshots and backups using an automated protection policy or on an ad-hoc basis.
|
You can configure Trident protect to freeze and unfreeze filesystems during data protection operations. Learn more about configuring filesystem freezing with Trident protect. |
Create an on-demand snapshot
You can create an on-demand snapshot at any time.
|
Cluster-scoped resources are included in a backup, snapshot, or clone if they are explicitly referenced in the application definition or if they have references to any of the application namespaces. |
-
Create the custom resource (CR) file and name it
trident-protect-snapshot-cr.yaml
. -
In the file you created, configure the following attributes:
-
metadata.name: (Required) The name of this custom resource; choose a unique and sensible name for your environment.
-
spec.applicationRef: The Kubernetes name of the application to snapshot.
-
spec.appVaultRef: (Required) The name of the AppVault where the snapshot contents (metadata) should be stored.
-
spec.reclaimPolicy: (Optional) Defines what happens to the AppArchive of a snapshot when the snapshot CR is deleted. This means that even when set to
Retain
, the snapshot will be deleted. Valid options:-
Retain
(default) -
Delete
-
-
-
After you populate the
trident-protect-snapshot-cr.yaml
file with the correct values, apply the CR:
Create an on-demand backup
You can back up an app at any time.
|
Cluster-scoped resources are included in a backup, snapshot, or clone if they are explicitly referenced in the application definition or if they have references to any of the application namespaces. |
Ensure that the AWS session token expiration is sufficient for any long-running s3 backup operations. If the token expires during the backup operation, the operation can fail.
-
Refer to the AWS API documentation for more information about checking the current session token expiration.
-
Refer to the AWS IAM documentation for more information about credentials with AWS resources.
-
Create the custom resource (CR) file and name it
trident-protect-backup-cr.yaml
. -
In the file you created, configure the following attributes:
-
metadata.name: (Required) The name of this custom resource; choose a unique and sensible name for your environment.
-
spec.applicationRef: (Required) The Kubernetes name of the application to back up.
-
spec.appVaultRef: (Required) The name of the AppVault where the backup contents should be stored.
-
spec.dataMover: (Optional) A string indicating which backup tool to use for the backup operation. Possible values (case sensitive):
-
Restic
-
Kopia
(default)
-
-
spec.reclaimPolicy: (Optional) Defines what happens to a backup when released from its claim. Possible values:
-
Delete
-
Retain
(default)
-
-
Spec.snapshotRef: (Optional): Name of the snapshot to use as the source of the backup. If not provided, a temporary snapshot will be created and backed up.
-
-
After you populate the
trident-protect-backup-cr.yaml
file with the correct values, apply the CR:
Create a data protection schedule
A protection policy protects an app by creating snapshots, backups, or both at a defined schedule. You can choose to create snapshots and backups hourly, daily, weekly, and monthly, and you can specify the number of copies to retain.
|
Cluster-scoped resources are included in a backup, snapshot, or clone if they are explicitly referenced in the application definition or if they have references to any of the application namespaces. |
Ensure that the AWS session token expiration is sufficient for any long-running s3 backup operations. If the token expires during the backup operation, the operation can fail.
-
Refer to the AWS API documentation for more information about checking the current session token expiration.
-
Refer to the AWS IAM documentation for more information about credentials with AWS resources.
-
Create the custom resource (CR) file and name it
trident-protect-schedule-cr.yaml
. -
In the file you created, configure the following attributes:
-
metadata.name: (Required) The name of this custom resource; choose a unique and sensible name for your environment.
-
spec.dataMover: (Optional) A string indicating which backup tool to use for the backup operation. Possible values (case sensitive):
-
Restic
-
Kopia
(default)
-
-
spec.applicationRef: The Kubernetes name of the application to back up.
-
spec.appVaultRef: (Required) The name of the AppVault where the backup contents should be stored.
-
spec.backupRetention: The number of backups to retain. Zero indicates that no backups should be created.
-
spec.snapshotRetention: The number of snapshots to retain. Zero indicates that no snapshots should be created.
-
spec.granularity: The frequency at which the schedule should run. Possible values, along with required associated fields:
-
hourly
(requires that you specifyspec.minute
) -
daily
(requires that you specifyspec.minute
andspec.hour
) -
weekly
(requires that you specifyspec.minute, spec.hour
, andspec.dayOfWeek
) -
monthly
(requires that you specifyspec.minute, spec.hour
, andspec.dayOfMonth
)
-
-
spec.dayOfMonth: (Optional) The day of the month (1 - 31) that the schedule should run. This field is required if the granularity is set to
monthly
. -
spec.dayOfWeek: (Optional) The day of the week (0 - 7) that the schedule should run. Values of 0 or 7 indicate Sunday. This field is required if the granularity is set to
weekly
. -
spec.hour: (Optional) The hour of the day (0 - 23) that the schedule should run. This field is required if the granularity is set to
daily
,weekly
, ormonthly
. -
spec.minute: (Optional) The minute of the hour (0 - 59) that the schedule should run. This field is required if the granularity is set to
hourly
,daily
,weekly
, ormonthly
.
-
-
After you populate the
trident-protect-schedule-cr.yaml
file with the correct values, apply the CR:
Delete a snapshot
Delete the scheduled or on-demand snapshots that you no longer need.
-
Remove the snapshot CR associated with the snapshot:
Delete a backup
Delete the scheduled or on-demand backups that you no longer need.
-
Remove the backup CR associated with the backup:
Check the status of a backup operation
You can use the command line to check the status of a backup operation that is in progress, has completed, or has failed.
-
Use the following command to retrieve status of the backup operation, replacing values in brackes with information from your environment:
Enable backup and restore for azure-netapp-files (ANF) operations
If you have installed Trident protect, you can enable space-efficient backup and restore functionality for storage backends that use the azure-netapp-files storage class and were created prior to Trident 24.06. This funtionality works with NFSv4 volumes and does not consume additional space from the capacity pool.
Ensure the following:
-
You have installed Trident protect.
-
You have defined an application in Trident protect. This application will have limited protection functionality until you complete this procedure.
-
You have
azure-netapp-files
selected as the default storage class for your storage backend.
Expand for configuration steps
-
Do the following in Trident if the ANF volume was created prior to upgrading to Trident 24.10:
-
Enable the snapshot directory for each PV that is azure-netapp-files based and associated with the application:
-
Confirm that the snapshot directory has been enabled for each associated PV:
Response:
snapshotDirectory: "true"
When the snapshot directory is not enabled, Trident protect chooses the regular backup functionality, which temporarily consumes space in the capacity pool during the backup process. In this case, ensure that sufficient space is available in the capacity pool to create a temporary volume of the size of the volume being backed up.
-
The application is ready for backup and restore using Trident protect. Each PVC is also available to be used by other applications for backups and restores.