Skip to main content
Skip table of contents

Regular Backup Operations

Velero provides the following basic administrative functions to back up production clusters:

If you require a custom backup location, see how to create one for AWS, Azure, or GCP.

Prepare your Environment

Before you modify a schedule or create an on-demand backup, set the following environment variables:

  1. Specify the workspace namespace of the cluster for which you want to configure the backup:

    CODE
    export WORKSPACE_NAMESPACE=<workspace_namespace>
  2. Specify the cluster for which you want to create the backup:

    CODE
    export CLUSTER_NAME=<target_cluster_name>

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

DKP default backups do not support the creation of Volume Snapshots.

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.

Create Backup Schedules

The Velero CLI provides an easy way to create alternate backup schedules. For example:

CODE
velero create schedule <backup-schedule-name> -n ${WORKSPACE_NAMESPACE} \
--kubeconfig=${CLUSTER_NAME}.conf \
--snapshot-volumes=false \
--schedule="@every 8h"

Change Default Backup Service Settings

  1. Check the backup schedules currently configured for the cluster:

    CODE
    velero get schedules
  2. Delete the velero-default schedule:

    CODE
    velero delete schedule velero-default 
  3. Replace the default schedule with your custom settings:

    CODE
    velero create schedule velero-default -n ${WORKSPACE_NAMESPACE} \
    --kubeconfig=${CLUSTER_NAME}.conf \
    --snapshot-volumes=false \
    --schedule="@every 24h"

Create Backup Schedule for a Specific Namespace

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:

CODE
velero create schedule <backup-schedule-name> \
--include-namespaces=kube-system,kube-public,kommander \
--snapshot-volumes=false \
--schedule="@every 24h"

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 to create a backup outside the regularly-scheduled interval. For example, if you are preparing to upgrade any components or modify your cluster configuration, perform a backup before taking that action.

Create a backup by running the following command:

CODE
velero backup create <backup-name> -n ${WORKSPACE_NAMESPACE} \
--kubeconfig=${CLUSTER_NAME}.conf \
--snapshot-volumes=false 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.