For backing up production clusters, you should be familiar with the following basic administrative functions Velero provides:
Set a Backup Schedule
By default, DKP configures a regular, automatic backup of the cluster’s state in Velero. The default settings do the following:
Create daily backups
Save the data from all namespaces
These default settings take effect after the cluster is created. If you install DKP with the default platform services deployed, the initial backup starts after the cluster is successfully provisioned and ready for use.
Alternate backup schedules
The Velero CLI provides an easy way to create alternate backup schedules. For example, you can use a command similar to:
velero create schedule thrice-daily --schedule="@every 8h"
To change the default backup service settings:
Check the backup schedules currently configured for the cluster by running the following command:CODE
velero get schedules
velero-defaultschedule by running the following command:CODE
velero delete schedule velero-default
Replace the default schedule with your custom settings by running the following command:CODE
velero create schedule velero-default --schedule="@every 24h"
You can also create backup schedules for specific namespaces. Creating a backup for a specific namespace can be useful for clusters running multiple apps operated by multiple teams. For example:
velero create schedule system-critical --include-namespaces=kube-system,kube-public,kommander --schedule="@every 24h"
Back up on Demand
In some cases, you might find it necessary create a backup outside of the regularly-scheduled interval. For example, if you are preparing to upgrade any components or modify your cluster configuration, you should perform a backup immediately before taking that action.
Create a backup by running the following command:
velero backup create <BACKUP-NAME> --snapshot-volumes=false