bitpoke / mysql-operator

Asynchronous MySQL Replication on Kubernetes using Percona Server and Openark's Orchestrator.
https://www.bitpoke.io/docs/mysql-operator/getting-started/
Apache License 2.0
1.03k stars 276 forks source link

Implement backup policies #726

Open calind opened 3 years ago

calind commented 3 years ago

Currently we backup on a simple crontab entry and we keep the last X backups. We should allow for more complex scenarios, like keep the last 24 hourly backups, the last 7 daily backups, and the last 4 weekly backups.

To do this we should deprecate/migrate backupSchedule, backupURL, backupSecretName, backupScheduleJobsHistoryLimit, backupRemoteDeletePolicy and have a backupPolicy entries and have something like:

backup:
  url: s3://....
  remoteDeletePolicy: ...
  secretName: ...
  schedule:
    - name: "hourly"
      keep: 24
      cron: "0 * * * *"
    - name: "daily"
      keep: 30
      cron: "0 0 * * *"

Another way to define a backup schedule would be the tarsnapper format (https://github.com/miracle2k/k8s-snapshots#how-the-deltas-work).

cndoit18 commented 3 years ago

This may involve an upgrade of the MysqlCluster GVK. Is our next version v1beta1?