GeassBackupArchive
A GeassBackupArchive is the Geass record of the backups of one database. The archive names these items:
- The S3 bucket and folder where the backups are.
- How long the backups are kept.
- Which restore points exist.
Geass creates the archive for you after a database has backups turned on and the project has backup storage. You do not create or edit an archive. The dashboard reads the archive to list restore points, and a restore refers to the archive by name. The archive outlives the database for a grace period, so you can still restore a database that was deleted.
For the task-oriented view, see Backups and restore.
Summary
Section titled “Summary”| Property | Value |
|---|---|
| API version | geass.geass.dev/v1alpha1 |
| Kind | GeassBackupArchive |
| Plural | geassbackuparchives |
| Scope | Namespaced. Geass keeps every archive in geass-system. |
| Subresources | status |
Printer column Database |
.spec.database |
Printer column Last backup |
.status.lastBackupTime |
Printer column Delete after |
.spec.deleteAfter, printed as the time itself. A date that has not come yet cannot be printed as an age. |
| Finalizer | None |
Example
Section titled “Example”Geass writes archives. This example is here so that you can read the fields.
apiVersion: geass.geass.dev/v1alpha1kind: GeassBackupArchivemetadata: name: orders-db-1a2b3c4d namespace: geass-systemspec: project: storefront environment: production database: orders-db databaseUID: 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d serverName: orders-db-1a2b3c4d storage: connectionRef: name: storefront-aws bucket: geass-backups-0123456789ab region: eu-west-1 retentionDays: 14 source: engine: Postgres version: "16" databaseName: orders-db storageSize: 20GiSpec fields
Section titled “Spec fields”| Field | Type | Required or default | Validation | Meaning |
|---|---|---|---|---|
spec.project |
string | Required | Minimum length 1 | The project that owned the database. |
spec.environment |
string | Required | Pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$, max length 63 |
The environment that the database ran in. |
spec.database |
string | Required | Minimum length 1. CEL: self == oldSelf, message “database cannot be changed” |
The name of the GeassDatabase that owns the backups. |
spec.databaseUID |
string | Required | Minimum length 1. CEL: self == oldSelf, message “databaseUID cannot be changed” |
The metadata.uid of the database. It tells a database apart from a later database that reuses its name. |
spec.serverName |
string | Required | Minimum length 1. CEL: self == oldSelf, message “serverName cannot be changed” |
The folder that the backups are in. The value is the database name, cut to 40 characters, plus the first 8 characters of the UID. So a new database never writes into the backups of an old database. |
spec.storage |
object | Required | CEL: self == oldSelf, message “storage cannot be changed” |
Where the backups are kept. The value is fixed when the archive is created. An archive continues to write where its history is, whatever the project says later. |
spec.storage.connectionRef |
LocalObjectReference | Required | None | The AWS GeassCloudConnection that owns the bucket. |
spec.storage.connectionRef.name |
string | CRD default "" |
None | The name of the connection. |
spec.storage.bucket |
string | Required | 3 to 63 characters, pattern ^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$ |
The S3 bucket. If the bucket does not exist, Geass creates it. |
spec.storage.region |
string | Optional | None | The region of the bucket. Geass writes the region that it resolved. |
spec.retentionDays |
integer (int32) | Required | Minimum 1, maximum 365 | How many days back you can restore the database. The value follows the spec.backup.retentionDays of the database. |
spec.source |
object | Optional | None | What a restore needs to know about the original database. |
spec.source.engine |
string | Optional. Empty means Postgres. | Enum Postgres, MySQL, SQLite, Redis, MariaDB |
The engine of the source database. |
spec.source.version |
string | Optional | None | The Postgres major version. Other engines do not record a version. |
spec.source.databaseName |
string | Optional | None | The database name. Geass records it for Postgres and MySQL. |
spec.source.storageSize |
Quantity | Optional | None | The disk size of the source. A restored database needs at least this much. |
spec.source.resources |
ResourceRequirements | Optional | None | The CPU and memory that the source used. |
spec.source.highAvailability |
boolean | Optional | None | Whether the source ran as a replicated cluster. Geass records it for MariaDB. A replicated MariaDB is backed up with physical copies and archived logs. It can be restored to any moment, and it must be restored into a replicated database. |
spec.source.instances |
integer | Optional | None | How many instances the source ran. A restore starts with the same number. |
spec.deleteAfter |
date-time | Optional | None | When Geass removes the backups. The field is empty while the database is protected. It is set when the database is deleted or backups are turned off. |
Status
Section titled “Status”| Field | Type | Meaning |
|---|---|---|
status.lastBackupTime |
date-time | When the latest backup finished. |
status.recoveryWindowStart |
date-time | The earliest moment that you can restore to. |
status.recoveryWindowEnd |
date-time | The latest moment that is known to be recoverable. While the database runs, this time is about 5 minutes behind the present. It stops moving after the database is deleted. |
status.restorePoints |
list | Base backups, newest first, at most 100. Each has id and time. For MySQL and SQLite, each daily snapshot is a restore point. |
status.conditions |
list | The only condition is Purged. |
The Purged condition is only ever False. Geass sets it when it cannot remove backups that are past
spec.deleteAfter. When the removal succeeds, the archive is deleted.
| Reason | Meaning |
|---|---|
ConnectionUnavailable |
The AWS connection, its Secret, or its keys are gone. The message says which one, for example cloud connection "storefront-aws" is unavailable. |
PurgeFailed |
AWS refused the delete. The message is the AWS error code and text, for example AccessDenied: Access Denied. |
Geass tries again every 15 minutes.
Lifecycle
Section titled “Lifecycle”-
Created. The database controller creates an archive the first time that the database has backups on and the project has backup storage. The name of the archive is the
serverName. If a database had backups, and then turned them off and on again, the new archive takes the name with-2,-3, and so on. -
Kept in step. On every reconcile, Geass updates
retentionDays,source, the labels, and the display-name annotation. Geass writes the restore points and recovery window instatusfrom what the cluster and the bucket report. -
Retired. Geass sets
spec.deleteAfterto 7 days from now in these cases:- The database is deleted, after a final backup.
- Backups are turned off.
- The namespace of the database changes.
The backups stay restorable until then. If the owning database disappears without the usual clean-up, the archive controller retires its archive in the same way.
-
Purged. After
deleteAfterhas passed, the archive controller deletes everything under<project>/<serverName>/in the bucket: objects, old versions, and unfinished uploads. Then the controller deletes the archive. The controller never touches an archive whose database is alive.
An archive has these labels: geass.dev/managed-by=geass, geass.dev/kind=GeassDatabase, geass.dev/name=<database>,
geass.dev/system-namespace=geass-system, geass.dev/project, and geass.dev/environment. The annotation
geass.dev/display-name holds the display name of the database.
What the dashboard does
Section titled “What the dashboard does”The dashboard only reads archives.
| Where | What it does |
|---|---|
| Resource panel, Backups tab | Shows the restore points, Last backup, and the recovery window from the archive that belongs to the database. When spec.deleteAfter is set, the tab says that the backups are kept until that date. |
| Restore buttons on the Backups tab | Creates a new GeassDatabase whose spec.restoreFrom.archive is the name of this archive. If the original environment no longer exists, the dialog asks for an Environment. |
| Project Settings > Backups > Recently deleted databases | Lists archives whose database is gone and that have a spec.deleteAfter, as Deleted · restorable until <date>. Each one has a Restore button. |
| Project Settings > Backups > Backup storage (Use this connection) | Sets the spec.backupStorage of the project. New archives copy it into spec.storage. |
A viewer in the dashboard sees archives with spec.storage cleared. The API reads them as backupArchives in
GET /api/bootstrap (geass api GET /bootstrap). A token that cannot change things gets the same cleared copy. The
command line and the MCP server have no archive command or tool. A restore from them goes through
POST /api/v1/databases/restore, which creates the new database with spec.restoreFrom.archive.
Editing by hand
Section titled “Editing by hand”Do not create archives. Do not delete archives either. The resource has no finalizer, so a delete of an archive does
not remove the backups in S3. Geass forgets the backups, and they stay in the bucket. Instead, let spec.deleteAfter
run its course.
The fields database, databaseUID, serverName, and storage cannot be changed. The API server rejects the edit.
What happens under the hood
Section titled “What happens under the hood”- The bucket holds one folder for each archive:
s3://<bucket>/<project>/<serverName>/. Postgres writes its base backups and change log there. MySQL and SQLite writedumps/<timestamp>.sql.gzfiles there. - Geass creates a bucket named
geass-backups-<random>, and an IAM usergeass-<bucket>. The inline policygeass-bucketof that user is limited to that bucket. The credentials are stored in the Secretgeass-backup-storage-<bucket>ingeass-system, with the keysACCESS_KEY_ID,ACCESS_SECRET_KEY, andREGION. A copy is in the namespace of each database as<database>-backup-credentials. The AWS root keys never leavegeass-system. - Postgres archives use a CloudNativePG
ScheduledBackupand the archiving of the cluster itself. MySQL and SQLite use a CronJob<database>-backupand a Job for each backup. If the database was placed with the required tags of the project, these jobs run on nodes that have those tags. See GeassDatabase. - The bucket is in your AWS account, so required node tags do not extend to the backups. See Backups and restore.
kubectl -n geass-system get geassbackuparchiveskubectl -n geass-system get geassbackuparchive orders-db-1a2b3c4d -o yaml
# Credentials Geass created for the bucketkubectl -n geass-system get secrets | grep geass-backup-storageTroubleshooting
Section titled “Troubleshooting”Purged is False
Section titled “Purged is False”The archive is past deleteAfter, and Geass could not delete the backups. For ConnectionUnavailable, restore the AWS
GeassCloudConnection that the archive names, with the same name
and working keys. For PurgeFailed, read the AWS error in the message. The usual cause is a missing permission. Geass
tries again every 15 minutes.
The archive stays after you deleted the database
Section titled “The archive stays after you deleted the database”This behavior is intended. Geass keeps the archive for 7 days after the database is deleted, so that you can restore
the database. Delete after shows the date.
A restore says These backups are no longer available
Section titled “A restore says These backups are no longer available”The archive named in spec.restoreFrom.archive does not exist. Either the archive was purged, or the name is wrong.
Check kubectl -n geass-system get geassbackuparchives.
The archive has no restore points
Section titled “The archive has no restore points”The first backup has not finished. See the status.backup message on the database: Taking the first backup, or an
AWS error. A restore needs at least one restore point. Without one, the restore refuses with
These backups have no restore points yet.