Skip to content

Backups

Crios ships a built-in disaster-recovery CronJob that captures every stateful component into a single checksummed archive on a schedule you control, with the irreplaceable secrets encrypted. Enable it in your values file and give it an encryption key before you rely on the install.

What gets backed up

Each run produces one archive, crios-backup-<YYYYMMDD-HHMMSS>.tar.gz (UTC), with these components:

Component Contents
postgres Dumps of the control-plane database (crios) and, when present, the git server's database, plus the database roles when the dump user may read them
project-dbs A dump of every project PostgreSQL database, named databases included: those on crios-project-db, with the per-project login roles so restored databases keep accepting the credentials Vault holds, and those on each running dedicated live-app instance. See what it leaves out
qdrant / qdrant_generalized Snapshots of every collection in both vector stores (project knowledge and the failure-fix knowledge base)
vault A Vault raft snapshot: the full, encrypted secrets state
gitea The git server's data directory (repositories); skipped when the git server is disabled
registry The published-app image registry; skipped when there is no registry
publications Published-app definitions, plus their TLS certificates (age-encrypted), including certificates users uploaded, which exist nowhere else
secrets An age-encrypted export of the generated Kubernetes Secrets the data depends on: database and generated passwords, and the project-database admin credential

The archive contains a SHA256SUMS file for its contents, and a .sha256 file for the archive itself is written next to it. The run's manifest.json, recording each component's status, detail and size and any delivery failure, is written after delivery: it is uploaded next to the archive on S3 (<name>.manifest.json), copied to the backup volume, when there is one, as manifest.json (the latest run's), and printed at the end of the job log.

Components run independently: if one fails, the others still run, the archive is still delivered, and the job is marked failed so you notice. A run may take up to 3 hours (backup.activeDeadlineSeconds, 10800 seconds) before Kubernetes stops it; raise it if your runs grow longer, since a stopped run delivers nothing.

Escrow the Vault unseal key and root token, apart from your backups

The archive contains the Vault snapshot but, on purpose, not the unseal key and root token that open it: kept next to the snapshot, the archive plus your age key would unlock every secret in Vault. A restored Vault can only be unsealed with the original unseal key, so store the unseal key and root token from the first-boot initialization in your password manager, somewhere other than the backup bucket, and again after any rekey. Without them, a restored Vault stays sealed and every provider and connector key has to be entered again.

They live in the namespace <namespace>-vault-keys. To copy them out of the cluster:

kubectl -n <namespace>-vault-keys get secret vault-unseal-key -o jsonpath='{.data.unseal-key}' | base64 -d
kubectl -n <namespace>-vault-keys get secret crios-vault-init-token -o jsonpath='{.data.token}' | base64 -d

After you rotate them, keep the old unseal key and root token too, for as long as you keep backups from before the rotation: a Vault restored from one of them opens only with the key it had then, and knows only the root token it had then.

No archive holds them: the chart refuses backup.includeVaultKeys, which used to add them to the encrypted secrets export.

What the project-dbs component leaves out

The nightly archive holds project data stored in PostgreSQL on crios-project-db and on the dedicated live-app instances. It does not hold:

  • the development copies that build sessions write when dedicated project datastores are on, so data that exists only in a development copy is not in the archive. With singleTier there are no development copies: builds write the live database, which is backed up;
  • a live-app instance that is not running when the backup runs, for example one parked by durableParkAfter, which is skipped without failing the component;
  • projects' MySQL databases;
  • projects' key-value and document stores.

If your projects keep data there that you cannot rebuild, back it up separately with the engine's own tools.

Encryption with age

The secrets and the publication certificates are always encrypted with age, a small modern file-encryption tool. Generate a key pair on your workstation:

age-keygen -o crios-backup-key.txt
# Public key: age1...

Put only the public recipient in your values:

backup:
  enabled: true
  schedule: "0 3 * * *"
  ageRecipient: "age1..."
  keepLast: 7

Warning

Store the private key offline, outside the cluster (password manager, printed copy in a safe). Without it, the encrypted parts of your backups cannot be decrypted. Without the recipient configured, the job refuses to export secrets in cleartext and the secrets and publications components fail.

To encrypt the whole archive, every database dump included, set backup.archiveAgeRecipient as well. The job then writes crios-backup-<timestamp>.tar.gz.age and never a cleartext archive; without it the archive itself is written in cleartext, with a warning on every run. Both values take several public keys separated by spaces, and any one of the matching private keys decrypts:

backup:
  ageRecipient: "age1<yours> age1<second-custodian>"
  archiveAgeRecipient: "age1<yours> age1<second-custodian>"

You hold these private keys, not Crios. A second key held by someone else (or kept under different custody) means losing one key does not lose your backups.

Crios Cloud: your backup key

On a managed Crios Cloud instance, backups are encrypted to your age key. Crios never holds the private key, so it cannot decrypt your backups, and it cannot restore them without you.

  1. On your own computer, install age and run age-keygen -o key.txt.
  2. Sign in to the billing portal. Under Your cloud, open Backup encryption on your cluster and paste the Public key: age1… line that age-keygen printed (it is also at the top of key.txt). Paste only the public key: the portal refuses a private key (AGE-SECRET-KEY-…) without sending it anywhere.
  3. Keep key.txt offline and safe. Add a second key held by another person if you can: you can register up to five.

Until a key is set, your instance takes no backups and the portal shows a warning: Crios never writes an unencrypted backup of a customer instance. Once you add a key, nightly encrypted backups are switched on after the change is applied to your instance, which the portal shows. The archives go to your own bucket, which your instance admin sets under Admin → Backups (below). Until a bucket is set there, a run has nowhere to deliver its archive and fails, so set one as soon as backups are on.

To restore, Crios support sends you a one-time public key for the restore. You decrypt the archive with your key on your own computer and re-encrypt it to that one-time key, so your private key never leaves you; support then restores it and destroys the one-time key.

Every component can be switched off under backup.components (postgres, projectDatabases, qdrant, vault, gitea, registry, publications, secrets); all are on by default.

Destinations

Backups go to an S3-compatible bucket, off the cluster. An archive volume on the cluster itself is available as an option but is off by default, because a copy on the cluster's own disk does not survive the loss of that disk. At least one destination must work, or the run fails with no destination succeeded (configure backup.s3 and/or backup.pvc); with neither configured, every run fails that way.

S3-compatible (required by the values template):

backup:
  s3:
    bucket: "<org>-crios-backups"
    endpoint: ""            # empty for AWS S3; set for MinIO, R2 and others
    prefix: ""              # optional key prefix inside the bucket
    credentialsSecret: "crios-backup-s3"  # keys: access-key, secret-key
kubectl -n <namespace> create secret generic crios-backup-s3 \
  --from-literal=access-key=<access-key> \
  --from-literal=secret-key=<secret-key>

S3 retention is left to your bucket's lifecycle rules. You can also set the bucket from the app instead; see Managing backups from the app.

Volume (optional, off by default):

backup:
  pvc:
    enabled: true
    size: 20Gi

keepLast controls how many archives are kept on the volume, oldest pruned first. The volume survives chart uninstalls.

Managing backups from the app

Instance admins can see and steer backups under Admin → Backups, without kubectl or a values change.

The top of the tab shows the Destination:, whether Credentials: are configured, the Schedule: and the Last success:. If backup.enabled is off, a banner says so; you can still configure the destination, which applies once backups are enabled.

Object-storage destination sets or changes the S3-compatible destination at run time. Pick a Provider preset (AWS S3, MinIO or Google Cloud Storage in S3-interoperability mode with an HMAC key), then fill in the Endpoint URL (required for MinIO), Bucket, Region, Key prefix, Access key and Secret key; leave the keys empty to keep the stored credentials. Save destination stores it in the crios-backup-destination Secret, which overrides the chart's backup.s3 values on the next run; Remove override reverts to the chart values. Test connection uploads and deletes one probe object using the saved settings and shows the output. Changes apply on the next backup run; no restart is needed.

Recent backups lists the latest runs with Job, Type (manual or scheduled), State, Started and Finished, and Run backup now starts an on-demand run.

Verifying backups ran

kubectl -n <namespace> get cronjob crios-backup
kubectl -n <namespace> get jobs -l app.kubernetes.io/component=backup
kubectl -n <namespace> logs job/<latest-job-name>

The job log ends with the manifest; "status": "ok" means every enabled component succeeded. To trigger a run from the command line:

kubectl -n <namespace> create job --from=cronjob/crios-backup crios-backup-manual

Restoring

The release bundle includes an operator-side restore script, scripts/backup/restore-dr.sh. It takes a crios-backup-<timestamp>.tar.gz archive (or an encrypted .tar.gz.age one, decrypted on the fly with your age private key), checks it against its .sha256 file when one sits next to it, and restores components into a target namespace, using your age private key to decrypt the secrets. It scales the orchestrator down for the duration and asks for confirmation before every destructive step. Run it from a machine with kubectl, jq, curl and age:

./scripts/backup/restore-dr.sh crios-backup-<timestamp>.tar.gz \
  --namespace <namespace> --release crios --age-identity crios-backup-key.txt \
  --vault-unseal-key-file vault-unseal-key.txt --vault-root-token-file vault-root-token.txt
Option Meaning
--namespace Target namespace (required)
--release Helm release name (required; crios if you followed the install guide)
--components Comma-separated subset of secrets, publications, postgres, project-dbs, qdrant, vault, gitea, registry, billing, for example postgres,project-dbs. Default: everything in the archive
--age-identity age private key, required for the secrets component and the publications' certificates
--vault-unseal-key-file / --vault-root-token-file Files holding the escrowed unseal key and root token of the Vault the backup came from. Needed to restore Vault onto a new cluster; on the same cluster the script uses the ones in <namespace>-vault-keys
--vault-keys-namespace Where the unseal key and root token live. Default: <namespace>-vault-keys
--skip-scale Do not scale the orchestrator down and up around the restore
--yes Skip the confirmations

Order matters, and the script follows it: secrets first, so the databases and Vault come back with matching credentials, then publications, the control-plane database, the project databases, the vector stores, Vault, the git server and the registry. After losing a whole cluster, restore the secrets component before installing the chart, so the chart reuses the restored secrets instead of generating new ones; then install and restore the data components.

Project databases from crios-project-db restore into that instance. A published app's database from a dedicated instance restores only into that same instance, and only while it is running: the script warns about each one it cannot find, marks the run failed and moves on; once the instance runs, re-run the restore with --components project-dbs. After losing a whole cluster, Crios brings the dedicated instances back on its own: within minutes of the restored control-plane database coming up, it recreates every project database instance that is missing, empty and with the same credentials as before, so published apps reconnect without a republish. Wait until they are running, then re-run the restore with --components project-dbs to fill them. MySQL, key-value and document store instances come back empty with new credentials, since their data is not in the backup; republish the projects that use them.

To restore Vault onto a new cluster, the script initializes the new, empty Vault with a throwaway key, loads the snapshot, unseals it with your escrowed unseal key, checks that your escrowed root token works, and stores both where the chart expects them, in <namespace>-vault-keys, so Vault unseals itself after restarts. Without the original unseal key the restored Vault stays sealed and the script stops with instructions.

Tip

Rehearse a restore into a scratch namespace or cluster before you need one for real, and always take a fresh backup before upgrading. For assistance with a live recovery, contact Crios support.