You can set up your workload cluster backup schedule operation for a specific time. You also can change the backup retention period and delete a backup.

Schedule a Backup

You can set up the back schedule at a specific time. The schedule time format is defined by Cron expression. For example, the command below creates a backup that runs at 3:00 AM every day.

# velero schedule create <example-schedule> --exclude-resources=$TCA_VELERO_EXCLUDE_RESOURCES --include-namespaces <example-namespaces-by-comma> --schedule="0 3 * * *"

Delete a Schedule

Use the following command to delete schedules.

# velero schedule delete <schedule-names>
Note:

Deleting the backup schedule won't delete the backups created by the schedule.

Set up a Backup Retention

The default backup retention period is managed by the Time to Live (TTL) value. By default, the TTL value is 30 days (720 hours). To change the TTL value, run the velero command by specifying the value of hours, minutes, and seconds in the form of --ttl 24h0m0s:

# velero backup create <example-backup> --ttl 24h0m0s

Delete a Backup

You can delete a backup resource including all the data in the object storage by running the following command:

# velero backup delete <example-backup>

Backup Hooks

When performing a backup, you can specify one or more commands to execute in a container in a pod while that pod is being backed up. There are two ways to specify hooks: annotations on the pod itself, and in the Backup spec. For more infomation, refer to velero offical doc.

Adjust Velero Memory Limits (If Necessary)

You can increase the limits and requests memory settings of velero.

1. Run the following command.

# kubectl edit deployment/velero -n velero

2. Change the limits and request memory settings from the default of 512Mi and 128Mi to 512Mi and 256Mi.

ports: 
- containerPort: 8085
  name: metrics
  protocol: TCP 
resources:   
  limits:
     cpu: "1"
     memory: 512Mi
  requests:
     cpu: 500m
     memory: 256Mi 
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File