Skip to main content
Version: Next

Backups and restores

The backup.openeverest.io API group holds the resources for backups. For a task-oriented guide, see Backup and restore.

BackupStorage​

A namespaced S3-compatible bucket. Only the s3 type is supported.

apiVersion: backup.openeverest.io/v1alpha1
kind: BackupStorage
metadata:
name: s3-backups
namespace: demo
spec:
type: s3
s3:
bucket: openeverest-backups
region: us-east-1
endpointURL: https://s3.us-east-1.amazonaws.com
forcePathStyle: false
verifyTLS: true
credentialsSecretRef:
name: s3-backups-credentials # keys AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
FieldDescription
s3.bucketBucket name.
s3.regionBucket region.
s3.endpointURLURL of the S3 service.
s3.forcePathStyleUse path-style URLs. Needed by most self-hosted S3 services.
s3.verifyTLSVerify the endpoint's TLS certificate.
s3.credentialsSecretRef.nameSecret in the same namespace with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

OpenEverest adopts the credentials Secret, so it is deleted together with the storage. A storage that is still used by an instance or a backup can't be deleted; it stays Terminating until it is no longer used.

BackupClass​

A cluster-scoped description of how backups are taken. Providers install their backup classes; you rarely create one yourself.

kubectl get backupclasses
FieldDescription
displayName, descriptionShown in the UI.
supportedProvidersProviders that can use the class.
executionModeProviderManaged — the provider and its Operator take the backups — or Job — OpenEverest runs a Kubernetes Job, for example with pg_dump.
supportsImportWhether backups in a storage can be discovered and imported with a BackupImport.
providerManaged.supportsPITRWhether point-in-time recovery is supported.
providerManaged.limitsLimits per instance, such as the number of PITR-enabled storages.
parametersSchema, restoreParametersSchemaSchemas of the extra parameters accepted by Backup.spec.parameters and Restore.spec.parameters.

Only ProviderManaged classes can be used in Instance.spec.backup and for creating instances from backups.

Instance backup settings​

Backups of an instance are configured in Instance.spec.backup:

FieldDescription
enabledTurns backups on for the instance.
classRef.nameThe BackupClass to use. It must list the instance's provider.
storages[].storageRef.nameA BackupStorage in the same namespace.
storages[].schedules[]Schedules writing to this storage: name, enabled, cron, and optional retention and parameters. Schedule names must be unique across storages.
storages[].schedules[].retention{type: count, count: 7} keeps the last 7 backups; {type: time, duration: 30d} keeps backups for 30 days (d, w or m). Omit to keep all backups.
storages[].pitr.enabledUpload the transaction log to this storage for point-in-time recovery.
storages[].pitr.parametersPITR settings defined by the backup class.

The point-in-time recovery window of each storage is reported in Instance.status.backup.

Backup​

One backup of an instance. Schedules create Backup resources automatically; create one yourself for an on-demand backup.

apiVersion: backup.openeverest.io/v1alpha1
kind: Backup
metadata:
name: orders-db-before-migration
namespace: demo
spec:
origin:
type: Instance
instanceRef:
name: orders-db
classRef:
name: pg
storageRef:
name: s3-backups
deletionPolicy: Delete
FieldDescription
origin.typeInstance for backups of an OpenEverest instance, External for imported backups.
origin.instanceRef.nameThe instance to back up.
classRef.name, storageRef.nameBackup class and storage.
scheduleNameSet on backups created by a schedule.
parametersExtra settings defined by the backup class, such as the backup type.
deletionPolicyDelete (default) removes the data from the storage when the backup is deleted, Retain keeps it.

The status.state is Pending, Running, Succeeded, Failed, Error or Deleting. Only Succeeded backups can be restored.

Restore​

Restores data into an existing instance.

apiVersion: backup.openeverest.io/v1alpha1
kind: Restore
metadata:
name: orders-db-restore-1
namespace: demo
spec:
instanceRef:
name: orders-db
dataSource:
type: Backup
backup:
backupRef:
name: orders-db-before-migration
FieldDescription
instanceRef.nameThe instance to restore into.
dataSource.typeBackup or PointInTime.
dataSource.backup.backupRef.nameThe backup to restore.
dataSource.pointInTime.source.storageRef.nameThe storage holding the transaction log.
dataSource.pointInTime.source.instanceRef.nameThe instance whose log to use. Defaults to the target instance.
dataSource.pointInTime.recoveryTargetdate or latest.
dataSource.pointInTime.dateThe time to restore to, when recoveryTarget is date.
parametersExtra settings defined by the backup class.

The same dataSource structure is used in Instance.spec.dataSource to create a new instance from a backup.

BackupImport​

Scans a backup storage for backups that OpenEverest doesn't know about yet, so they can be imported and used to create instances. The Import database page in the UI creates BackupImport resources for you. Only backup classes with supportsImport: true can be used.