Skip to content

Backups for managed apps #1713

Open
7 of 7 issues completed
Open

Description

Cozystack Backups API and implementation

Design doc

The initial design doc can be found here

Tasks

Completed

The core API is implemented by the following PRs:

The reference strategy implementation is also complete:

State of the strategy track as of 2026-08-03

Six of the seven drivers now ship a default Strategy CR and are routed by the platform cozy-default BackupClass (packages/system/backupstrategy-controller/templates/backupclass-default.yaml, mirrored in docs/operations/backup-classes.md): Postgres via cozy-default-cnpg, MariaDB via cozy-default-mariadb, Etcd via cozy-default-etcd, ClickHouse via cozy-default-altinity, VMInstance via cozy-default-velero-vminstance and VMDisk via cozy-default-velero-vmdisk.

Two gaps remain on this track, both deliberate rather than forgotten:

  • FoundationDB ships strategy-foundationdb-default.yaml but is not bound into cozy-default, because restore runs fdbrestore inside the operator pod and cozy-foundationdb-operator does not mount the projected cozy-backups-creds, so a platform-default FDB restore would fail silently. Wiring that Secret into the operator deployment is what unblocks the binding.
  • The generic Job driver landed but ships no default Strategy CR, so it is bring-your-own only.

TODO

The various types of storage refs need to be implemented and the contracts between the various controllers need to be described. Example contract for the reference strategy above may be:

The job driver executes a script that streams a tarball to a well-known location in a pod's volume. Any storage driver runs as a sidecar in the same pod, watches the filesystem at the well-known location. The incoming tarball is passed on to the backend for storing the backups (S3, NFS, Cozystack bucket, etc).

  • Formalize the contract
  • Generalize it sufficiently to be applicable for various strategies

PVCs are a special case. Contemporary solutions such as velero+kopia deliver unsatisfactory performance. ZFS snapshots can be leveraged to increase efficiency, doing, e.g.

  • Weekly full backups of a volume
  • Daily incremental backups from snapshots

However, this requires subsequent backups to be "aware" of previously existing backups (i.e. for series of snapshots to be linked to their base backup).

  • Design a structure for the metadata
    • The shape of its structs, data types, etc
    • How is it stored
    • How is it discovered
    • How is it referenced in the CRs stored in K8s
  • Design a procedure for backing up volumes
    • Proof of concept with a script that can back up a ZFS-backed PVC
    • Proof of concept with a script that can save an incremental backup
    • Proof of concept with a script that can download the base backup, the incremental backups, and reconstruct the PVC in a cluster
    • Additional feature: use all of the above, then rebuild a KubeVirt DataVolume from the PVC restored from a backup and relaunch a VM
  • Automate all of the above

TBC

Activity

  1. changed the title [-]Implement backups for managed apps[/-] [+]Backups for managed apps[/+] on Dec 11, 2025
  2. added
    kind/featureCategorizes issue or PR as related to a new feature
    on Dec 11, 2025
  3. added
    epicA large development increment that brings definite value to Cozystack users
    on Dec 11, 2025
  4. androndo commented on Aug 3, 2026

    @androndo
    Contributor

    Updated the body after auditing every open backup issue against main (04b742670). What changed, so the edit is auditable:

    • ticked feat(backups): implement Job backup strategy #1721 — it merged 2026-05-27, and it was the last unchecked box in the reference-implementation group, so that whole group is now complete and no longer sits under "TODO".
    • added a state-of-play block: six of the seven drivers ship a default Strategy CR and are routed by cozy-default (Postgres, MariaDB, Etcd, ClickHouse, VMInstance, VMDisk).
    • added the two remaining strategy-track gaps as explicit checkboxes, because both were previously implicit: FoundationDB ships a strategy but is deliberately not bound into cozy-default (restore runs fdbrestore in the operator pod, which does not mount the projected cozy-backups-creds), and the generic Job driver has no default Strategy CR so it is bring-your-own only.

    Nothing was deleted. The storage-ref contract items and the whole ZFS incremental-volume block are untouched and still open — that is where the bulk of this epic now sits.

    For the visibility sibling: #2609 was also refreshed (its console section was scoped to cozystack/cozystack-ui, which is archived — the console is in-tree now, and part of that section has since landed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

epicA large development increment that brings definite value to Cozystack userskind/featureCategorizes issue or PR as related to a new featuretriage/acceptedIndicates an issue is ready to be actively worked on

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions