Hide navigation
Components

Backup

Overview

The backup in Kyma uses Ark.

NOTE: The Ark project changed its name to Velero. The full migration is planned once the new Velero version is available.

Ark backs up Kubernetes resources and stores them in Azure Blob storage. It triggers physical volume snapshots and includes the snapshot references in the backup. Ark can create scheduled or on-demand backups, filter objects to include in the backup, and set time to live (TTL) for stored backups.

For more details, see the official Ark documentation.

Configuration

The Ark configuration consists of two custom resources:

A sample BackupStorageLocation CR looks like this:

Click to copy
kind: BackupStorageLocation
metadata:
name: default
namespace: heptio-ark
spec:
config:
resourceGroup: BackupStorage
storageAccount: foo...
objectStorage:
bucket: bucket
provider: azure

A sample VolumeSnapshotLocation CR looks like this:

Click to copy
kind: VolumeSnapshotLocation
metadata:
name: azure-default
namespace: heptio-ark
spec:
config:
apiTimeout: 15m
provider: azure

A Kyma installation provides a set of default snapshot and storage locations. If needed, you can add custom locations in the heptio-ark Namespace.

Back up a Kyma cluster

Kyma provides two validated sample backup specification files:

Integrate these files with your scheduled or on-demand configurations to back up system or user Namespaces.

NOTE: To fully back up a cluster, you must back up both user and system Namespaces.

Modify the files to adjust the backup scope. For details about the file format, see the Ark documentation.

Create manual backups

If you want to use sample backup configurations, you must use Backup custom resources instead of Ark CLI. Add the following two CRs to the heptio-ark Namespace to instruct the Ark server to create a backup. Make sure the indentation is correct.

A sample backup configuration looks like this:

Click to copy
---
apiVersion: ark.heptio.com/v1
kind: Backup
metadata:
name: kyma-system-backup
namespace: heptio-ark
spec:
<INCLUDE CONTENT OF SYSTEM NAMESPACE BACKUP FILE HERE>
---
apiVersion: ark.heptio.com/v1
kind: Backup
metadata:
name: kyma-backup
namespace: heptio-ark
spec:
<INCLUDE CONTENT OF USER NAMESPACE BACKUP FILE HERE>

To create the backup, run the following command:

$ kubectl apply -f &#60;filename>

Schedule periodic backups

If you want to use sample backup configurations, ou must use Schedule custom resources instead of Ark CLI. Create two Schedule custom resources in the heptio-ark Namespace to instruct the Ark Server to schedule a cluster backup. Make sure the indentation is correct.

A sample scheduled backup configuration looks like this:

Click to copy
---
apiVersion: ark.heptio.com/v1
kind: Schedule
metadata:
name: kyma-system-backup
namespace: heptio-ark
spec:
template:
<INCLUDE CONTENT OF SYSTEM NAMESPACE BACKUP SPEC HERE>
schedule: 0 1 * * *
---
apiVersion: ark.heptio.com/v1
kind: Schedule
metadata:
name: kyma-backup
namespace: heptio-ark
spec:
template:
<INCLUDE CONTENT OF SYSTEM NAMESPACE BACKUP SPEC HERE>
schedule: 0 1 * * *

To schedule a backup, run the following command:

$ kubectl apply -f <filename>

Backup retention period

To set the retention period of a backup, define the ttl parameter in the Backup specification definition:

Click to copy
ttl: 24h0m0s

Restore a Kyma cluster

Restoring a Kyma cluster requires a fresh Kyma installation. As soon as the cluster is up and running, instruct Ark to start the restore process. Make sure to restore the system and user Namespaces at the same time so both are in sync.

Use this command to list available backups:

$ kubectl get backups -n heptio-ark

Sample restore configuration:

Click to copy
---
apiVersion: ark.heptio.com/v1
kind: Restore
metadata:
name: kyma-restore
namespace: heptio-ark
spec:
backupName: null # specify to restore a specific backup
scheduleName: kyma-backup # Applies only if no backup is specified.
restorePVs: true
includeClusterResources: true
---
apiVersion: ark.heptio.com/v1
kind: Restore
metadata:
name: kyma-system-restore
namespace: heptio-ark
spec:
backupName: null # specify to restore a specific backup
scheduleName: kyma-system-backup # Applies only if no backup is specified.
restorePVs: true
includeClusterResources: true

To trigger the restore process, run this command:

$ kubectl apply -f <filename>

To check the restore progress, run this command:

$ kubectl describe restore -n heptio-ark <restore name>

To validate the result of the restore use the kubectl get command.

NOTE: Even if the restore process is complete, it may take some time for the resources to become available again.