Skip to content

GeassDatabase

A GeassDatabase is one database server for a project environment. It can run in your cluster (Postgres, MySQL, MariaDB, SQLite, or Redis), or it can point at a database that runs somewhere else.

The dashboard creates and edits a GeassDatabase when you add a database to a project. The dashboard is the normal way to work with one. You can also create it with kubectl. A GeassDatabase with no spec.project is the cluster-wide shared server. Many projects use this server through GeassLogicalDatabase resources.

For the task-oriented view, see Databases, Backups and restore, and Shared database servers.

Property Value
API version geass.geass.dev/v1alpha1
Kind GeassDatabase
Plural geassdatabases
Scope Namespaced. Create it in geass-system, because the dashboard and the other controllers only look there.
Subresources status
Printer column Environment .spec.environment
Printer column Engine .spec.engine
Printer column Ready .status.conditions[?(@.type=="Ready")].status
Finalizer geass.geass.dev/database

The database itself runs in the namespace of the project environment, <project>-<environment>. A shared server has no project, and it runs in geass-system.

Every example sets spec.deploy.enabled: true. The dashboard reads that field to tell a deployed database from a draft. The kubectl examples do not have the geass.dev/deploy-workflow annotation, so Geass provisions them immediately. See Drafts and the Deploy flow.

orders-db.yaml
apiVersion: geass.geass.dev/v1alpha1
kind: GeassDatabase
metadata:
name: orders-db
namespace: geass-system
spec:
project: storefront
environment: production
engine: Postgres
version: "16"
storageSize: 20Gi
resources:
requests:
cpu: 500m
memory: 1Gi
limits:
cpu: 500m
memory: 1Gi
backup:
enabled: true
retentionDays: 14
deploy:
enabled: true

Backups protect the database only after the project has backup storage. See Backups.

orders-db-ha.yaml
apiVersion: geass.geass.dev/v1alpha1
kind: GeassDatabase
metadata:
name: orders-db
namespace: geass-system
spec:
project: storefront
environment: production
engine: Postgres
highAvailability: true
storageSize: 20Gi
deploy:
enabled: true

Geass runs three instances. It holds the database back until a GeassHAReadiness report says that the cluster has at least three healthy nodes.

orders-db-restored.yaml
apiVersion: geass.geass.dev/v1alpha1
kind: GeassDatabase
metadata:
name: orders-db-restored
namespace: geass-system
spec:
project: storefront
environment: production
engine: Postgres
version: "16"
storageSize: 20Gi
backup:
enabled: true
restoreFrom:
archive: orders-db-1a2b3c4d
time: "2026-10-11T09:30:00Z"
deploy:
enabled: true

restoreFrom.archive is the name of a GeassBackupArchive. The new database must have the same engine, Postgres version, and database name as the original. It must also have at least the storage of the original. See Restoring.

orders-planetscale.yaml
apiVersion: geass.geass.dev/v1alpha1
kind: GeassDatabase
metadata:
name: orders-planetscale
namespace: geass-system
spec:
project: storefront
environment: production
engine: MySQL
placement: External
provider: PlanetScale
mode: Create
connectionRef:
name: storefront-planetscale
deploy:
enabled: true

connectionRef names a GeassCloudConnection for PlanetScale that is scoped to the same project. engine can be MySQL or Postgres, because PlanetScale hosts only those two. externalPort is optional, and its default is the port of the engine. To select the size that PlanetScale creates the database with, add clusterSize. See External databases.

orders-external.yaml
apiVersion: geass.geass.dev/v1alpha1
kind: GeassDatabase
metadata:
name: orders-external
namespace: geass-system
spec:
project: storefront
environment: production
engine: Postgres
placement: External
mode: Connect
externalHost: db.example.com
externalPort: 5432
username: orders
databaseName: orders
passwordSecretRef:
name: orders-external-password
key: password
deploy:
enabled: true
orders-external-password.yaml
apiVersion: v1
kind: Secret
metadata:
name: orders-external-password
namespace: geass-system
stringData:
password: change-me

The Secret must be in geass-system, next to the GeassDatabase.

cluster-postgres.yaml
apiVersion: geass.geass.dev/v1alpha1
kind: GeassDatabase
metadata:
name: cluster-postgres
namespace: geass-system
spec:
engine: Postgres
serverRegion: eu
storageSize: 20Gi
deploy:
enabled: true

With no project, this database is the cluster-wide server. Projects take databases on it with GeassLogicalDatabase.

The API server fills in the defaults marked “CRD default”. The operator applies the defaults marked “controller” when the field is empty.

Field Type Required or default Validation Meaning
spec.project string Optional None The owning project. If it is empty, this database is the cluster-wide shared server, which runs in geass-system.
spec.org string Optional Pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$, max length 63 Makes a shared server (one with no project) the server of an organization. Only the projects of that organization can take logical databases on it, and only its people see it. It runs where the organization requires its work to run (its region and node tags). Geass ignores this field when spec.project is set. Empty means that the server belongs to the platform. While organizations are on, a platform server is only for the projects of no organization, so that a server never holds the data of two organizations. While organizations are off, it is for every project. A platform administrator changes this field with POST /api/shared-databases/{name}/org. This call refuses while the server holds a database of another owner. See Shared database servers.
spec.environment string Optional. Required in practice for a project database. Pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$, max length 63 The project environment. It must be one of the spec.environments of the project. Empty for a shared server.
spec.engine string Required Enum Postgres, MySQL, SQLite, Redis, MariaDB The database engine. MariaDB runs the official image under the MariaDB operator. SQLite runs rqlite, which serves SQLite over HTTP on port 4001. Redis runs without a volume. A PlanetScale database can be MySQL or Postgres.
spec.placement string CRD default InCluster Enum InCluster, External InCluster runs the database in the cluster. External connects to a database somewhere else.
spec.provider string Optional Enum PlanetScale, AWS The external provider. It has an effect only with placement: External. PlanetScale with mode: Create makes Geass create the database on PlanetScale. AWS only labels the status message, because Geass has no RDS client.
spec.mode string Optional Enum Create, Connect Only Create with provider: PlanetScale changes behavior. Connect and an empty value behave the same: Geass uses the host, username, and password that you give it.
spec.highAvailability boolean false None Asks for a multi-instance topology. Only in the cluster. Needs a ready GeassHAReadiness report. Postgres, MySQL, and MariaDB only. Not supported for SQLite or Redis.
spec.connectionRef LocalObjectReference Optional None A GeassCloudConnection in geass-system. It must be scoped to the same project.
spec.connectionRef.name string CRD default "" None Name of the connection.
spec.databaseName string Optional. The controller uses the resource name. None The database name. Geass uses it for Postgres (initdb), for MySQL and MariaDB, for the database key of the connection Secret, and as the PlanetScale database name.
spec.externalHost string Optional None Host of an external database. Used for placement: External.
spec.externalPort integer (int32) Optional. The controller uses the default port of the engine (5432, 3306, 6379, or 4001). None Port of an external database.
spec.clusterSize string Optional. Empty leaves the size to PlanetScale. None in the CRD. The dashboard API rejects a size on a database that is not on PlanetScale. When it can check, it also rejects a name that PlanetScale does not offer for the engine The PlanetScale cluster size that Geass creates the database with, for example PS_10. Geass reads it only when it creates the database on PlanetScale (provider: PlanetScale, mode: Create). A later change does not resize the database. After the connection Secret exists, the dashboard API refuses the change. The dashboard API lists the sizes at GET /api/planetscale/cluster-sizes?project=<project>&connection=<connection>&engine=MySQL (or Postgres). The dashboard has no field for it.
spec.username string Optional None Login for an external database.
spec.passwordSecretRef SecretKeySelector Optional None Secret in geass-system that holds the external password. If the key is empty, its default is password.
spec.passwordSecretRef.name string CRD default "" None Secret name.
spec.passwordSecretRef.key string Required when passwordSecretRef is set None Key in the Secret.
spec.passwordSecretRef.optional boolean Optional None Standard Kubernetes field. Geass does not read it.
spec.version string CRD default "16" None Postgres major version. Geass uses it as the image tag ghcr.io/cloudnative-pg/postgresql:<version>. MySQL, MariaDB, Redis, and SQLite do not read it. Their versions come from the images that Geass pins (mysql:8.4.11, mariadb:11.8.9, redis:7.4.11-alpine, rqlite/rqlite:8.36.16).
spec.instances integer (int32) CRD default 1 Minimum 1 Number of instances. With highAvailability, Geass uses at least 3. See the caution under Engines and high availability.
spec.storageSize Quantity Optional. The controller uses 10Gi, or 1Gi for SQLite. None Disk size for each instance. Redis and external databases do not use it. The dashboard writes it explicitly.
spec.resources ResourceRequirements Optional. The controller uses 250m CPU and 512Mi memory (SQLite: 100m and 128Mi). None CPU and memory for each instance. Geass reads it only when requests is set. Set requests and limits together.
spec.deploy.enabled boolean false None Gates provisioning, but only for resources that have the geass.dev/deploy-workflow: "true" annotation. The API, the command line, and the MCP server report a database with this field false as draft, whatever the annotation says. See Drafts and the Deploy flow.
spec.backup object Optional None Backups for in-cluster Postgres, MySQL, MariaDB, and SQLite. Geass ignores it for Redis and external databases.
spec.backup.enabled boolean Required when backup is set None Turns on backups.
spec.backup.retentionDays integer (int32) CRD default 7 Minimum 1, maximum 365 How many days back you can restore.
spec.restoreFrom object Optional CEL: !(has(self.restorePoint) && has(self.time)), message “set either restorePoint or time, not both” Creates this database from the backups of another database. Geass reads it one time, while it first provisions the database.
spec.restoreFrom.archive string Required when restoreFrom is set Minimum length 1 Name of the GeassBackupArchive to restore from.
spec.restoreFrom.restorePoint string Optional Exclusive with time ID of a restore point listed on the archive.
spec.restoreFrom.time date-time Optional Exclusive with restorePoint Restore to this moment. Postgres only. It must be inside the recovery window of the archive.
spec.runOn.tags array of strings Optional Max 8 items, each matching ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ and at most 40 characters, set semantics Node tags that the database must run on. A node needs all of them. The spec.requiredTags of the project also apply, and you do not list them here. Geass reads this field one time, when it first provisions the database.
spec.serverRegion string Optional Pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$, max length 40 Where a shared server runs. A database with a project follows the region of its project instead.
Engine What Geass runs Host in status.host Backups
Postgres A CloudNativePG Cluster named after the database. <name>-rw.<namespace>.svc Continuous. Restore to any moment.
MySQL One pod from the official mysql:8.4.11 image, as the StatefulSet geass-mysql-<name> with a volume. With highAvailability: true, a MOCO MySQLCluster of three or five servers instead. geass-mysql-<name>.<namespace>.svc, or with high availability moco-<name>-primary.<namespace>.svc Daily snapshot.
MariaDB The official mariadb:11.8.9 image, which the MariaDB operator runs as a MariaDB. One server, or with highAvailability: true, three or five servers that replicate to each other. <name>.<namespace>.svc, or with high availability <name>-primary.<namespace>.svc One server: daily snapshot. With high availability: physical copies and archived logs, restore to any moment.
SQLite One rqlite pod (rqlite/rqlite:8.36.16) with a volume, as a Deployment. <name>.<namespace>.svc Daily snapshot.
Redis One pod from the official redis:7.4.11-alpine image, as the StatefulSet geass-redis-db-<name>-master. No volume: the data does not survive when the pod is replaced. geass-redis-db-<name>-master.<namespace>.svc None.

With highAvailability: true, Postgres, MySQL, and MariaDB run three instances. MySQL and MariaDB run three or five, as instances says. When Longhorn is installed, these instances use the single-replica storage class geass-single, because the instances replicate the data themselves.

Redis runs as one instance. Geass refuses a request for highAvailability: true, or for more than one instance, with the message High availability requires PostgreSQL, MySQL, or MariaDB: Redis runs as a single instance. Turn it off, or choose PostgreSQL, MySQL, or MariaDB. SQLite refuses with the message SQLite does not support high availability.

Geass never creates a database with placement: External in your cluster. Geass reads the host, port, username, and password from the spec, writes the connection Secret, and reports Ready. It does not test the connection.

For provider: PlanetScale with mode: Create, Geass calls the PlanetScale API with the token from the connection:

  1. Geass looks for a PlanetScale database named spec.databaseName, or named after the resource. If there is none, Geass creates one of the kind that matches spec.engine: mysql for MySQL, and postgresql for Postgres. It uses spec.clusterSize when you set it. If a database with that name already exists with the other kind, Geass refuses it with PlanetScale database "<name>" already exists as <kind>, not <kind>. Geass refuses any other engine with PlanetScale hosts MySQL and Postgres databases, not <engine>.
  2. A new database takes minutes to provision. Until PlanetScale reports it ready, Ready is False with the message PlanetScale database is starting. This message does not count as a failure. After 30 minutes, the message becomes PlanetScale database did not become ready within 30m0s; check the database in PlanetScale, and it counts as a failure.
  3. When the database is ready, Geass issues a login on the main branch: a branch password for MySQL, and a role that inherits the postgres role for Postgres. PlanetScale shows the password only one time. Thus, Geass immediately stores the host, username, and password in <name>-connection. If Geass cannot store them, it revokes the login again.

The port is spec.externalPort, or the default of the engine (3306 for MySQL, 5432 for Postgres). If you delete the connection Secret, Geass issues a new login. For Postgres, the database key of the Secret is the database name that PlanetScale gives the role.

The dashboard creates resources as drafts:

  • The dashboard sets spec.deploy.enabled: false. It adds the annotation geass.dev/deploy-workflow: "true", a pending-change counter (geass.dev/pending-updates), and the kind list geass.dev/pending-changes.
  • While spec.deploy.enabled is false, the controller removes any resources that it created for the database. It reports Ready as False with the message Resource is configured and waiting for deployment.
  • Deploy changes in the top bar sets spec.deploy.enabled: true on every pending resource of the environment. It clears the pending markers, and it stores a copy of the spec in the geass.dev/last-deployed annotation.
  • After the first deploy, Geass holds back the edits that you save in Settings. The controller continues to run the last deployed copy while geass.dev/pending-updates is above zero. The one exception is spec.backup, which takes effect when you save it.

The gate applies only when the annotation geass.dev/deploy-workflow is "true". A GeassDatabase without that annotation provisions immediately when it is valid, whatever spec.deploy.enabled says. Set spec.deploy.enabled: true anyway. The dashboard uses it to decide whether volumes exist, whether storage can only grow, and whether the node choice is locked.

Field Type Meaning
status.targetNamespace string The namespace that the database runs in.
status.connectionSecret string Name of the Secret with the connection details, <name>-connection.
status.host string Host of the database. The dashboard shows it as Endpoint.
status.restoredAt date-time When a snapshot restore (MySQL or SQLite) finished. This field stops Geass from loading the snapshot a second time.
status.backup object Backup summary. Absent while backups are off.
status.backup.state string One of NeedsStorage, Starting, Protected, or AtRisk.
status.backup.message string Plain-language explanation of the state.
status.backup.archive string Name of the GeassBackupArchive that holds the backups of this database.
status.backup.lastBackupTime date-time When the latest backup finished.
status.backup.recoveryWindowStart date-time The earliest moment that you can restore to.
status.reconcileRetry object Counters for consecutive failures: reconcileFailures, reconcileFailureStarted, reconcileFailureGeneration.
status.provision object Deploy history. activeProvisionAttempt is the ID of the running attempt. provisionAttempts keeps the newest 8. Each attempt has id, startedAt, completedAt, phase (Running, Succeeded, or Failed), summary, and up to 12 errors (recordedAt, message). Only services use buildRef and deploymentRef.
status.conditions list Ready. Also Sandboxed, for the server of an organization while the platform runs the code of organizations in a sandboxed runtime. See Sandboxed condition.

Ready has three reasons:

Reason Status Meaning
DatabaseReady True The database is running, and the connection Secret exists. The message names the engine, for example Postgres database is ready. For an external database, it is PlanetScale database is ready or AWS database is ready.
ReconcileError False Not ready yet. The message says what Geass waits for, or what failed. Geass checks again after 30 seconds.
ProvisionFailed False Geass stopped trying. The message is always Provisioning failed after repeated errors. Update settings or platform configuration, then save or redeploy to try again.

Messages that describe a wait do not count as failures. All other messages count. Geass moves to ProvisionFailed in these cases:

  • Geass sees 5 counted failures in a row.
  • Counted failures last 3 minutes.
  • Immediately, for a permanent error: an unsupported engine, an access-denied error, or an invalid credential or configuration.

The exception is Could not pull the database image …. The kubelet waits minutes between pulls. Thus, for this message, Geass moves to ProvisionFailed only when the image has failed to pull for 10 minutes, however many passes that takes.

When the reason is ProvisionFailed, the controller stops reconciling that database until you change its spec or click Retry. A spec change is any edit that raises metadata.generation. Retry resets the counters, sets Ready back to ReconcileError with the message Retrying provisioning, and starts a new entry in status.provision.

These are the Ready messages that you can see, in the order that Geass checks them:

Message Meaning
Resource is configured and waiting for deployment A draft. Deploy it.
resource has pending changes and no last deployed snapshot The database has saved edits but no geass.dev/last-deployed copy. Deploy again from the dashboard.
project "<project>" does not exist, project "<project>" is not ready, project "<project>" has no <environment> environment The project or environment is missing or not ready.
project "<project>" cluster "<cluster>" is not ready The GeassCluster of the project is not Ready.
cloud connection "<name>" was not found, ... is scoped to project "<project>", ... must be scoped to a project spec.connectionRef is wrong.
High availability requires a cluster with at least three healthy nodes See Troubleshooting.
Storage is starting, Storage is unavailable Waiting for the Longhorn storage class. See Troubleshooting.
Installing Postgres operator chart, Installing MySQL operator chart, Installing MariaDB operator chart, Installing MySQL database chart Helm is installing a chart. Only a MySQL database on the old Bitnami chart shows Installing MySQL database chart.
PlanetScale database is starting PlanetScale is still creating the database. For up to 30 minutes, this wait does not count as a failure.
Postgres database is starting, Service is starting, Starting service Pods are starting.
Could not pull the database image <image> (<reason>) The pod of a MySQL or Redis server cannot get its image. <reason> is ErrImagePull, ImagePullBackOff, or InvalidImageName. A pull that is only slow shows Service is starting. This message counts as a failure, but only after 10 minutes.
Service failed to start Every pod of the chart failed.
Restoring database from backup A restore is running.
Waiting for the sandboxed runtime: RuntimeClass "<class>" is not in the cluster, … The new server of an organization waits for the sandboxed runtime of the platform. Geass makes no part of the server. This message does not count as a failure. See Sandboxed condition.
This database cannot run in the sandbox: …, so it is not made. … The PostgreSQL or MariaDB server of an organization, while the platform runs the code of organizations in a sandboxed runtime. Geass makes no part of the server. This message does not count as a failure, because only the platform can change it.

Sandboxed is on these servers:

  • The server of a project that belongs to an organization, while the spec.tenancy.sandbox of the platform is set.
  • A shared server whose spec.org names an organization, while that setting is set.
  • A server that still runs under a RuntimeClass after the setting was removed.

The condition tells you how the pods of the server run.

Status Reason Message Meaning
True RuntimeClass Runs under RuntimeClass gvisor The pods of the server are written under the RuntimeClass of the platform.
False ReservedNodes Runs without the sandbox, on nodes reserved for the organization (tag …) skipOnReservedNodes is on, and the server can run only on nodes reserved for its organization.
False RuntimeClassMissing Waiting for the sandboxed runtime: … The RuntimeClass is missing. Geass does not make a new server, and the new server is not ready. Geass leaves a server that runs exactly as it is, and its Ready keeps what it last said. Geass records a Warning event SandboxRuntimeClassMissing when the wait begins.
False or True RestartPending Runs without the sandbox until it is restarted into RuntimeClass gvisor, … (or Runs under RuntimeClass … until it is restarted …) The server ran before the setting, or before the setting changed. It waits for approval of its restart with the annotation geass.dev/sandbox-restart, or for databaseRestarts: Immediate. The status is True while the server still runs under a RuntimeClass. Geass records a Warning event SandboxRestartPending when the wait begins, and a SandboxRestart event when the server restarts.
False EngineCannotBeSandboxed This database cannot run in the sandbox: … PostgreSQL or MariaDB, whose operators cannot give their pods a RuntimeClass, or MySQL that is still on the Bitnami chart. Geass refuses a server that is not made yet, and Ready says the same. Geass holds a server that was made before: it changes or deletes nothing of that server, its pods continue to run outside the sandbox, and its Ready keeps what it last said. Geass records a Warning event SandboxEngineUnsupported one time.

Without the setting, the condition is not there, and nothing about the server changes.

Where What it does to the GeassDatabase
+ Add resource > Database > Database server > PostgreSQL, MySQL, MariaDB, Redis or SQLite Creates a draft with a generated name, for example falling-mist. It sets project, environment, engine, placement: InCluster, resources (250m and 512Mi, or 100m and 128Mi for SQLite), and storageSize (10Gi, or 1Gi for SQLite, none for Redis). For Postgres, MySQL, and SQLite, it also sets backup: {enabled: true, retentionDays: 7}. The dashboard saves a runOn choice only from a dashboard admin.
+ Add resource > Database > Database server > PlanetScale or AWS RDS Creates a draft with placement: External, provider, connectionRef, and an engine (MySQL for PlanetScale, Postgres for AWS RDS). See the caution under External databases.
+ Add resource > Database > Logical database > a server Creates a GeassLogicalDatabase, not a GeassDatabase.
Resource panel, Settings tab, Database section Version writes spec.version. Resources writes spec.resources. The sizes are 0.1, 0.25, 0.5, 1, or 2 CPU, and 128 MB to 4 GB. Size under Storage writes spec.storageSize. These changes wait for a deploy.
Settings tab, Scale section, Run on Writes spec.runOn.tags. You can edit it only before the first deploy. After that, the dashboard refuses with A database keeps its data on the nodes it was first deployed to, so which nodes it runs on cannot change after that.
Settings tab, Backups section (also the Backups tab) Back up this database and Keep backups for write spec.backup. They apply immediately.
Deploy changes in the top bar Runs the deploy flow for every pending resource of the environment. It first checks that the cluster has room for the database, or for three instances. The API deploys one database with POST /api/databases/<name>/deploy.
Retry Resets a ProvisionFailed database.
Console tab, Run query Runs your SQL in the database pod with psql -c, mysql -e, or redis-cli. For SQLite, it sends the SQL to the HTTP API of rqlite. It is not a field of the resource.
Restore buttons on the Backups tab Creates a new database with spec.restoreFrom. Geass deploys it immediately, without a draft.
Settings > Databases > Set up a server Creates a shared server: no project, spec.deploy.enabled: true, highAvailability from the High availability switch, and serverRegion from Region. The High availability switch also sets instances: 3.
Settings tab, Danger section Deletes the database after you enter its resource ID.

The dashboard enforces these storage rules:

  • At least 1Gi.
  • Only growth after the first deploy.
  • No change at all when the storage class cannot expand volumes.

The messages are storage can be increased but not decreased once deployed (currently <size>) and this cluster's storage can't be resized, so a deployed database stays at <size>.

A viewer in the dashboard sees a redacted copy of each database. The dashboard clears the engine, host, user, password reference, and connection details. A token that cannot change things gets the same copy from the API.

To Command MCP tool
List databases geass databases list list_databases
Read resource, spec, and status geass databases get NAME get_database
Read host, port, database, and username of the connection Secret geass databases connection NAME database_connection
Also read password and uri geass databases connection NAME --reveal None: the tool never returns them

These commands call GET /api/v1/databases, GET /api/v1/databases/{name}, and GET /api/v1/databases/{name}/connection. The state that they report is the first match in this list:

  • deleting, when metadata.deletionTimestamp is set.
  • draft, when spec.deploy.enabled is false.
  • ready, when Ready is True.
  • failed, when the reason of Ready is ProvisionFailed.
  • pending, in all other cases.

The connection call needs Full access. It works after status.targetNamespace and status.connectionSecret are set. Geass writes each reveal to the operator log. See Databases.

When the database is ready, Geass writes a Secret named <name>-connection in the namespace of the database. The Secret has these keys: host, port, database, username, password, and uri.

Engine uri
Postgres postgresql://<user>:<password>@<host>:5432/<database>
MySQL mysql://<user>:<password>@<host>:3306/<database>
MariaDB mysql://<user>:<password>@<host>:3306/<database>
Redis redis://:<password>@<host>:6379
SQLite http://<host>:4001

The login is app. Geass first writes the credentials to a Secret named <name>-bootstrap. The connection Secret copies them.

spec.backup protects in-cluster databases only. For Redis or external databases, the dashboard refuses to change it, with Backups are not available for this kind of database.

  • Postgres is archived continuously (CloudNativePG, Barman object store), and a base backup runs daily at about 02:00 UTC. You can restore to any moment in the recovery window.

  • The operator backs up a MariaDB database with high availability:

    • A PhysicalBackup <name>-backup makes a copy every night at about 02:00 UTC.
    • A PointInTimeRecovery <name>-pitr archives the binary logs of the primary to the same bucket.
    • A CronJob <name>-binlog-flush closes the log every five minutes, so that the log is archived.

    You can restore to any moment from the oldest copy to about fifteen minutes ago. On delete, a PhysicalBackup <name>-final makes a last copy.

  • A CronJob named <name>-backup copies MySQL, MariaDB (one server), and SQLite databases one time each day, at about 02:00 UTC. The copies are compressed SQL files. A restore returns the data as of one of them.

  • The backups go to the backup storage of the project: an S3 bucket in the AWS account of a GeassCloudConnection. When the spec.backupStorage of the project is set, Geass creates the bucket (geass-backups-<random>) and an IAM user scoped to it. Until then, status.backup.state is NeedsStorage. A shared server has no project, so it has no place to put backups.

  • Geass records the backups of each database in a GeassBackupArchive in geass-system.

  • Backups are an add-on. If Geass cannot work out the backup plan, the database continues to run, and Geass tries again after a minute.

  • When you delete a database, Geass makes one last backup, and waits up to 10 minutes for it. Then Geass keeps the archive for 7 days.

  • The Jobs that dump, restore, and make the final backup of a MySQL or SQLite database run in the region of the database. If the database was placed with the required tags of the project, these Jobs run on nodes that have those tags. The Jobs do not use spec.runOn.tags.

status.backup.state has these values:

State Meaning
NeedsStorage Backups are on, but the project has no place to put them, or the storage failed. The message is Choose where backups are stored to protect this database or Backup storage is not working: <AWS error>.
Starting Storage works, and the first backup has not finished. The message is Taking the first backup.
Protected Backups are running. The message is Backups are running.
AtRisk The message is Recent changes are not being saved to backup storage or The latest backup failed.

A restore always creates a new database next to the original. Geass does not touch the original. Geass refuses a restore that cannot succeed, with these messages:

Message Cause
These backups are no longer available The archive no longer exists.
Backups from another project cannot be restored here The archive belongs to a different project.
A restored database must use the same engine as the original (<engine>) Wrong spec.engine.
A restored database must use Postgres version <n>, the version of the backup Wrong spec.version.
A restored database must keep the database name <name> Wrong spec.databaseName.
A restored database needs at least <size> of storage, the size of the original spec.storageSize is too small.
These backups have no restore points yet The first backup has not finished.
The chosen restore point is not available restorePoint is not on the archive.
The chosen time is earlier than the oldest restore point, The chosen time is later than the newest recoverable moment time is outside the recovery window.
This database can only be restored to a restore point time on a MySQL or SQLite archive.
Choose either a restore point or a time, not both Both fields are set.
The backup storage is not available: <reason> Geass could not reach the bucket.
The restore could not be completed. Check that the backups are still available, then restore again The restore Job failed.

A restore runs only while Geass first provisions the database. Postgres recovers while the cluster is created. For MySQL and SQLite, a Job named <name>-restore loads the snapshot. Then Geass sets status.restoredAt, so that the snapshot never loads two times.

You can create a GeassDatabase with kubectl, and you can edit one. The dashboard shows it like any other database. Remember these points:

  • Geass writes the annotations geass.dev/storage-class and geass.dev/node-placement one time, when it first provisions the database. They pin the storage class of the volume and the nodes that the database runs on. Do not remove or edit them. geass.dev/node-placement is JSON with the region, the tags from spec.runOn.tags, and the required tags of the project at that moment. For example: {"region":"eu","tags":["storage"],"required":["hipaa"]}. An empty {} means that the database runs anywhere. See Where a database runs.
  • The dashboard writes geass.dev/display-name, geass.dev/deploy-workflow, geass.dev/pending-updates, geass.dev/pending-changes, and geass.dev/last-deployed.
  • With the sandboxed runtime of the platform on, Geass writes geass.dev/sandbox-runtime-class. This annotation holds the RuntimeClass that Geass writes the pods of the server with. Geass writes it when it makes the server, and when it restarts the server into the sandbox. Do not edit it, because Geass writes the pods of the server from it. To approve one restart of a running server into what the setting asks for, a platform administrator adds geass.dev/sandbox-restart (any value). Geass removes that annotation after the restart.
  • The controller does not rewrite the spec of a GeassDatabase. The status belongs to the controller.
  • Geass reads spec.restoreFrom, spec.runOn, and the storage class one time. A later change to them has no effect.
  • The size of a volume can grow but not shrink.

If you set spec.deploy.enabled back to false on a resource that has the geass.dev/deploy-workflow annotation, Geass treats the resource as a draft again. Geass deletes the resources that it built for the database. For Postgres and SQLite, the data volume goes with them.

To delete a database, delete the GeassDatabase. If backups are on, the finalizer first makes a final backup. Then the finalizer removes the resources that the next section lists. The dashboard refuses to delete a shared server while logical databases still use it. kubectl does not stop you.

Geass keeps the resource in geass-system. The workloads are in <project>-<environment>. Because they are in a different namespace, Geass cannot use owner references. Thus, Geass deletes them itself when you delete the resource. Objects that Geass creates have these labels: geass.dev/managed-by=geass, geass.dev/kind=GeassDatabase, geass.dev/name=<name>, geass.dev/system-namespace=geass-system, geass.dev/project, and geass.dev/environment.

Every in-cluster engine has these objects:

  • Secret <name>-bootstrap and Secret <name>-connection in the namespace of the database.
  • Optionally, Secrets <name>-backup-credentials and <name>-restore-credentials, which hold credentials scoped to the backup bucket.
  • Annotations geass.dev/storage-class and geass.dev/node-placement on the GeassDatabase.
  • If the sandboxed runtime of the platform is on, the server of an organization also has the annotation geass.dev/sandbox-runtime-class on the GeassDatabase. It also has runtimeClassName on the pods of the server and on the Jobs of its copies, restores, and logins. For the pods, Geass sets it in the template of the StatefulSet or Deployment, or in the spec.podTemplate.spec of a MOCO cluster.

Each engine also has these objects:

  • Postgres: a HelmChart geass-cloudnative-pg in kube-system installs the CloudNativePG operator into cnpg-system. Then a CNPG Cluster <name> runs in the namespace of the database. It has pods <name>-1 and <name>-2, a volume for each pod, and the Services <name>-rw, <name>-ro, and <name>-r. With backups, there is a ScheduledBackup <name>. On delete, there is a Backup named <name>-final. A Postgres database that hosts logical databases also gets a <name>-superuser Secret.
  • MySQL: a StatefulSet geass-mysql-<name> of one pod, the Services geass-mysql-<name> and geass-mysql-<name>-headless, and the volume claim data-geass-mysql-<name>-0. The logins of the pod come from the <name>-bootstrap Secret. A MySQL database made on an earlier development build of Geass is still a HelmChart geass-mysql-<name> in kube-system. That HelmChart is the Bitnami chart, whose images Bitnami has removed from Docker Hub. Geass leaves it exactly as it is.
  • MariaDB: a HelmChart geass-mariadb-operator-crds and a HelmChart geass-mariadb-operator in kube-system install the MariaDB operator into mariadb-system. The operator has two copies of each of its three parts. Then a MariaDB <name> runs in the namespace of the database. It has the StatefulSet <name>, its pods <name>-0 and higher, and a claim storage-<name>-<index> for each pod. It also has the Service <name> (standalone), or the Services <name>-primary and <name>-secondary (with high availability).
    • The operator makes the app login and the database from the <name>-bootstrap Secret. It also makes the root login from the same Secret.
    • With high availability, there is a suspended PhysicalBackup <name>-recovery. With backups on, there are the objects of the backups (see the Backups section) and a staging volume <name>-backup-staging that the operator makes.
    • A database restored from the backups of a replicated database also has a suspended PhysicalBackup and a PointInTimeRecovery, both named <name>-restore-source. These objects only tell where the copies and logs of the source are.
    • The annotation geass.dev/mariadb-initialized is put on the GeassDatabase the first time that the operator says that the database is ready. The annotation geass.dev/credentials-origin is put on a database restored from the backups of a replicated database. It names the database whose password the restored database carries.
    • The MariaDB has geass.dev/promotion-started while Geass waits for a promotion that it asked for. It has geass.dev/promotion-abandoned for half an hour after Geass gave up a promotion.
  • MySQL with high availability: a HelmChart geass-moco in kube-system installs MOCO into moco-system, with two controller pods, after cert-manager is running. Then a MySQLCluster <name> runs in the namespace of the database. It has the StatefulSet moco-<name>, its pods moco-<name>-0 and higher, a claim mysql-data-moco-<name>-<index> for each pod, and the Services moco-<name>-primary and moco-<name>-replica. A Job <name>-login-<id> makes the login and the database of the application. The Job uses the writing login of MOCO, moco-writable. The password of that login is in the Secret moco-<name>, which MOCO owns. Geass gives each server at least 1 GiB of memory.
  • Redis: a StatefulSet geass-redis-db-<name>-master of one pod, and the Services geass-redis-db-<name>-master and geass-redis-db-<name>-headless, with no volume. A Redis database made on an earlier development build used the Bitnami chart geass-redis-db-<name>. Geass moves that database to this server the next time that it reconciles the database. Geass removes the chart and makes the server in its place, with the message Replacing the Redis chart with Geass's own server. Redis keeps no data on disk, so the move costs the same as a restart of its pod.
  • SQLite: a Deployment <name>, a Service <name> on port 4001, and a PVC <name>-sqlite.
  • External: only the connection Secret.

To inspect these objects, run these commands:

Inspect a database
# The resource and its status
kubectl -n geass-system get geassdatabases
kubectl -n geass-system get geassdatabase orders-db -o yaml
# Where it runs
NS=$(kubectl -n geass-system get geassdatabase orders-db -o jsonpath='{.status.targetNamespace}')
# Everything Geass labelled for it
kubectl -n "$NS" get all,pvc,secrets -l geass.dev/name=orders-db
# Postgres
kubectl -n "$NS" get clusters.postgresql.cnpg.io orders-db
kubectl -n "$NS" get pods -l cnpg.io/cluster=orders-db
kubectl -n cnpg-system get pods
# MySQL or Redis
kubectl -n "$NS" get statefulsets,pods,pvc -l app.kubernetes.io/instance=geass-mysql-orders-db
# Backups
kubectl -n "$NS" get scheduledbackups,backups
kubectl -n geass-system get geassbackuparchives
# Read the connection details
kubectl -n "$NS" get secret orders-db-connection -o jsonpath='{.data.uri}' | base64 -d

The database stays in Draft or says it is waiting for deployment

Section titled “The database stays in Draft or says it is waiting for deployment”

The message is Resource is configured and waiting for deployment. The resource has the geass.dev/deploy-workflow: "true" annotation, and spec.deploy.enabled is false. Click Deploy changes in the top bar, or set spec.deploy.enabled: true. Saved edits also wait for a deploy. The dashboard shows the pending count in the top bar.

High availability requires a cluster with at least three healthy nodes

Section titled “High availability requires a cluster with at least three healthy nodes”

Geass looks for a GeassHAReadiness in geass-system whose Ready condition is True and whose status.healthyNodes is at least 3. If none exists, the database waits. To create the report, do these steps:

  1. Open Settings > Usage > HA readiness.
  2. Click Run readiness check.

Nothing else creates the report. If the cluster has fewer than three healthy nodes, add nodes. After the report exists, the operator calculates it again when a node, a storage class, or the Geass cluster changes. A waiting database checks again every 30 seconds.

Storage is starting, then Storage is unavailable

Section titled “Storage is starting, then Storage is unavailable”

New volumes wait for the Longhorn storage classes geass-replicated or geass-single. Some volumes wait for the regional geass-replicated-<region>, or for geass-tagged-<hash> in a project that requires node tags. If Longhorn is enabled and still installing, the database waits up to 15 minutes. Then it reports Storage is unavailable, and it counts this as a failure. Check the AddonsReady condition of the GeassCluster, and the pods in longhorn-system. After Geass selects a class, it pins that class. Thus, if you install Longhorn later, an existing volume does not change.

One wait has no limit. If Longhorn serves the global class, but the regional or tagged class that a database needs does not exist yet, the message stays Storage is starting. The cluster controller makes the class when at least one schedulable node is in its scope, and every such node has a ready Longhorn manager. See Storage.

This <engine> database needs about <cpu> CPU and <memory> memory. The cluster currently has ... available means that no node has room. Add nodes, or lower spec.resources. For There is no ready node in <place> to run this ... and ... reserved for other work, see Scaling and placement and GeassNode. <place> names the region and every tag that the database needs, including the required tags of the project. Geass checks capacity only when it first creates the database.

project "<project>" is not ready or has no <environment> environment

Section titled “project "<project>" is not ready or has no <environment> environment”

The database waits until its project and the cluster of the project are Ready. It also waits until the environment is listed in the spec.environments of the project.

The reason is ProvisionFailed and you cannot see why

Section titled “The reason is ProvisionFailed and you cannot see why”

Click Retry, and watch the Ready message:

Watch the Ready message
kubectl -n geass-system get geassdatabase orders-db -w \
-o custom-columns=NAME:.metadata.name,READY:.status.conditions[0].status,MESSAGE:.status.conditions[0].message

Geass continues to try for up to 5 failures or 3 minutes, and the message names the real problem. Also read the events and status of the objects in What happens under the hood.

A PlanetScale or external database is not ready

Section titled “A PlanetScale or external database is not ready”
  • external database host, username, and password are required: set externalHost, username, and passwordSecretRef. Or use mode: Create with a PlanetScale connection.
  • external password secret "<name>" is unavailable: the Secret is missing from geass-system.
  • a PlanetScale connection is required: spec.connectionRef is empty.
  • connection "<name>" is not a PlanetScale connection: the provider of the connection is AWS.
  • PlanetScale token and organization are required: the Secret of the connection does not have token. Or neither the spec.organization of the connection nor the organization key of the Secret is set.
  • PlanetScale API <status>: ...: PlanetScale refused the call. Check the permissions of the token and the organization name. If you set spec.clusterSize, also check that PlanetScale offers that size for the engine.
  • PlanetScale hosts MySQL and Postgres databases, not <engine>: spec.engine is Redis or SQLite. Use MySQL or Postgres.
  • PlanetScale database "<name>" already exists as <kind>, not <kind>: a database with that name exists in the organization with the other engine. Use another spec.databaseName.
  • PlanetScale database is starting for a long time, then PlanetScale database did not become ready within 30m0s: PlanetScale did not finish creating the database. Check the database in PlanetScale, and then click Retry.

NeedsStorage means that the project has no backup storage, or Geass cannot reach it. Under Choose where backups are stored, select an AWS connection. Then check the AWS error in status.backup.message. AtRisk means that the last backup failed, or the change log does not reach the bucket. Check the conditions of the CloudNativePG Cluster, or the <name>-backup Jobs in the namespace of the database.

Compare the message with the table in Restoring. Postgres reports Restoring database from backup while the new cluster recovers. A recovery that cannot finish appears as a database that stays in that state. In that case, check the pods <name>-1 and their logs.

Geass makes a final backup first, and waits up to 10 minutes for it. If the database is not running, or the backup fails, Geass skips the wait. Geass releases the finalizer when the resources are gone.

This database cannot run in the sandbox or Runs without the sandbox until it is restarted

Section titled “This database cannot run in the sandbox or Runs without the sandbox until it is restarted”

The platform runs the code of organizations in a sandboxed runtime. PostgreSQL and MariaDB cannot run in this runtime. Thus, Geass does not make the PostgreSQL or MariaDB server of an organization, and it holds a server that was made before as it is. Use MySQL instead, or ask the platform to turn off the sandbox. A server that ran before the sandbox was set waits until a platform administrator approves its restart into the sandbox. See Database servers.

A SQLite database answers 503 after its pod was replaced

Section titled “A SQLite database answers 503 after its pod was replaced”

A SQLite server that was made before Geass gave rqlite a fixed node ID (-node-id) has the host name of its pod as its name. A Deployment changes this host name with every pod. The new node is not in the raft configuration that is kept on the volume. Thus, rqlite logs “not part of a stable configuration”, and it answers 503 permanently.

In a test, the same image (rqlite v8.36.16) with a fixed -node-id on a volume answered with its data after a pod replacement. A server that this release makes starts with -node-id <name>. The arguments are unit-tested, but a server made by this release was not run. The recovery of a server made earlier was not tried, although the rqlite documentation describes it. Geass has no tool for this recovery.

A MySQL server in the sandbox is Ready, but its logins are refused

Section titled “A MySQL server in the sandbox is Ready, but its logins are refused”

Two new MySQL 8.4.11 servers of 512 MiB, the default size of Geass, were killed for lack of memory during their first start under gVisor. They were left with only root@localhost, no password for it, and no app login. The first logical database on them stayed at “creating logical database”. A server made with 1 GiB started cleanly. See What it costs.

This entry applies only to a MySQL database that still runs on the old Bitnami chart. Geass deletes the HelmChart object and the claim data-geass-mysql-<name>-0. It does not delete other persistent volume claims that the chart created. After you delete such a database, check kubectl -n <namespace> get pvc. For a MySQL database that Geass runs itself, Geass deletes the volume claims of its servers.