Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

[Proposal] support periodic backups #1841

@rjtsdl

Description

@rjtsdl

I already seen a bunch of ask about how to schedule periodic backup.

The current design will not support that, and suggest to use CronJob to create backup CR periodically (Only creation can trigger the actual backup handling function).

Here are some cons of this methods.

  • CronJob is scheduled by k8s scheduler. For clusters has 100s etcd-operators, it will be a big load on the scheduler. (It is not the option for me at Azure) @khenidak on more thoughts.
  • For users seeking backup operator, they are looking into a solution. Backup scheduling always comes with Backup itself
  • It is not very intuitive to create a CronJob with access to k8s api-server. It involves secret handling.

So, i propose to have backupPolicy option.

  • If backupPolicy not provided, it will not do periodic backup. It will be the same of existing behavior, which does one-time backup.
  • For backupIntervalInSecond
    • unit in Sec
    • >0 means interval. Of course, we will have the minimal interval limit.
    • =0 means explicit disable interval backup, it will just do one time backup.
    • <0 not allowed, failed validation
    • It doesn't need to strictly refer to the interval. For any reason the backup operator get restarted, we can just ignore the last backup time
  • For maxBackups
    • specify how many backups we want to keep
    • maxBackups == 0 => unlimited backup

Related Issues: #1787


Based on above proposal,

When user specify in backup CR

spec:
  backupPolicy:
    maxBackups: 4
    backupIntervalInSecond: 30
  s3:
     path: "mybucket/mycluster_backup"
  ...

We will have "mybucket/mycluster_backup_v{revision}_{date}"
And for each revision, we keep up to 4 revisions.

The same logic apply to restore operator as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions