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"
CODE

To change the default backup service settings:

  1. Check the backup schedules currently configured for the cluster by running the following command:

    velero get schedules
    CODE
  2. Delete the velero-default schedule by running the following command:

    velero delete schedule velero-default
    CODE
  3. Replace the default schedule with your custom settings by running the following command:

    velero create schedule velero-default --schedule="@every 24h"
    CODE

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"
CODE

The Velero command line interface provides many more options worth exploring. You can also find tutorials for disaster recovery and cluster migration on the Velero community site.

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
CODE