Disaster Recovery
For Connected and Disconnected Spaces, this feature requires Spaces v1.9.0 and, starting with v1.14.0, Spaces enables it by default.
To enable it on versions earlier than v1.14.0, set features.alpha.spaceBackup.enabled=true when you install Spaces.
up space init --token-file="${SPACES_TOKEN_PATH}" "v${SPACES_VERSION}" \
...
--set "features.alpha.spaceBackup.enabled=true"
Upbound's Space Backups is a built-in Space-wide backup and restore feature. This guide explains how to configure Space Backups and how to restore from one of them in case of disaster recovery.
This feature for Space administrators. Group or Control Plane users can leverage Shared Backups to backup and restore their ControlPlanes.
Benefits
The Space Backups feature provides the following benefits:
- Automatic backups for all resources in a Space and all resources in control planes, without any operational overhead.
- Backup schedules.
- Selectors to specify resources to backup.
Prerequisites
Enabled the Space Backups feature in the Space:
- Cloud Spaces: Not accessible to users.
- Connected Spaces: Space administrator must enable this feature.
- Disconnected Spaces: Space administrator must enable this feature.
Configure a Space Backup Config
SpaceBackupConfig is a cluster-scoped resource. This resource configures the storage details and provider. Whenever a backup executes (either by schedule or manually initiated), it references a SpaceBackupConfig to tell it where store the snapshot.
Backup config provider
The spec.objectStorage.provider and spec.objectStorage.config fields configures:
- The object storage provider
- The path to the provider
- The credentials needed to communicate with the provider
You can only set one provider. Upbound currently supports AWS, Azure, and GCP as providers.
spec.objectStorage.config is a freeform map of configuration options for the object storage provider. See Thanos object storage for more information on the formats for each supported cloud provider. spec.bucket and spec.provider overrides the required values in the config.
AWS as a storage provider
This example demonstrates how to use AWS as a storage provider for your backups:
apiVersion: admin.spaces.upbound.io/v1alpha1
kind: SpaceBackupConfig
metadata:
name: default
spec:
objectStorage:
provider: AWS
bucket: spaces-backup-bucket
config:
endpoint: s3.eu-west-2.amazonaws.com
region: eu-west-2
credentials:
source: Secret
secretRef:
name: bucket-creds
namespace: upbound-system
key: creds
This example assumes you've already created an S3 bucket called
spaces-backup-bucket in the eu-west-2 AWS region. To access the bucket,
define the account credentials as a Secret in the specified Namespace
(upbound-system in this example).
Azure as a storage provider
This example demonstrates how to use Azure as a storage provider for your backups:
apiVersion: admin.spaces.upbound.io/v1alpha1
kind: SpaceBackupConfig
metadata:
name: default
namespace: default
spec:
objectStorage:
provider: Azure
bucket: upbound-backups
config:
storage_account: upbackupstore
container: upbound-backups
endpoint: blob.core.windows.net
credentials:
source: Secret
secretRef:
name: bucket-creds
namespace: upbound-system
key: creds
This example assumes you've already created an Azure storage account called
upbackupstore and blob upbound-backups. To access the blob,
define the account credentials as a Secret in the specified Namespace
(upbound-system in this example).
GCP as a storage provider
This example demonstrates how to use Google Cloud Storage as a storage provider for your backups:
apiVersion: admin.spaces.upbound.io/v1alpha1
kind: SpaceBackupConfig
metadata:
name: default
namespace: default
spec:
objectStorage:
provider: GCP
bucket: spaces-backup-bucket
credentials:
source: Secret
secretRef:
name: bucket-creds
namespace: upbound-system
key: creds
This example assumes you've already created a Cloud bucket called
"spaces-backup-bucket" and a service account with access to this bucket. Define the key file as a Secret in the specified Namespace
(upbound-system in this example).
Configure a Space Backup Schedule
SpaceBackupSchedule is a cluster-scoped resource. This resource defines a backup schedule for the whole Space.
Below is an example of a Space Backup Schedule running every day. It backs up all groups having environment: production labels and all control planes in those groups having backup: please labels.
apiVersion: admin.spaces.upbound.io/v1alpha1
kind: SpaceBackupSchedule
metadata:
name: daily-schedule
spec:
schedule: "@daily"
configRef:
kind: SpaceBackupConfig
name: default
match:
groups:
labelSelectors:
- matchLabels:
environment: production
controlPlanes:
labelSelectors:
- matchLabels:
backup: please
Define a schedule
The spec.schedule field is a Cron-formatted string. Some common examples are below:
| Entry | Description |
|---|---|
@hourly | Run once an hour. |
@daily | Run once a day. |
@weekly | Run once a week. |
0 0/4 * * * | Run every 4 hours. |
0/15 * * * 1-5 | Run every fifteenth minute on Monday through Friday. |
@every 1h30m10s | Run every 1 hour, 30 minutes, and 10 seconds. Hour is the largest measurement of time for @every. |