rancher / rke2

https://docs.rke2.io/
Apache License 2.0
1.52k stars 264 forks source link

Enhanced etcd Backup Integration #566

Closed davidnuzik closed 3 years ago

davidnuzik commented 3 years ago

We want to integrate with Rancher etcd backup and restore. We'll need to include S3 bucket capability and scheduling via the API. on demand snapshots are also required.

cjellick commented 3 years ago

This feature is meant to bring RKE2's etcd backup and restore functionality on par with RKE1.

The current RKE2 snapshot/restore functionality is:

This feature seeks to enhance that functionality by:

Scope:

Open questions/unknowns:

Things I want to see in the design doc/design review:

cjellick commented 3 years ago

Rough LOE due by EOD 12/18

rajivml commented 3 years ago

I have noticed that the backups you guys are take are not incremental but a full backup every time, is it possible to do an incremental backup as well, so that the incremental backup can be scheduled at one minute interval

davidnuzik commented 3 years ago

@briandowns at first this issue was created thinking we need to see the whole thing thru including the integration-side with Rancher/UI. Seeing as how that's no longer the case I'd like to move this "To Test" is this something you are comfortable with? Basically let's not treat it like an epic or as an issue that must see the whole thing thru. The majority is all in for testing now. Could you move it to test?

briandowns commented 3 years ago

Yeah, I think that's a fair assessment. I'll update.

ShylajaDevadiga commented 3 years ago

Validated using v1.21.1-rc2+rke2r1

On-demand snapshot stored locally

rke2 etcd-snapshot 

Passing prefix to snapshot name

rke2 etcd-snapshot --name=snapshot1

On-demand snapshot stored in s3 bucket

rke2 etcd-snapshot \
    --s3 \
    --s3-bucket=<bucket-name> \
    --s3-access-key=<redacted> \
    --s3-secret-key=<redacted> \
    --s3-folder=<folder-name> 

Scheduled snapshot stored locally

rke2 server \
--etcd-snapshot-schedule-cron='* * * * *'

Scheduled snapshot stored locally with retention count

rke2 server \
--etcd-snapshot-schedule-cron='* * * * *' \
--etcd-snapshot-retention=2

Scheduled snapshot stored in s3 bucket with retention count

rke2 server \
    --etcd-s3 \
    --etcd-s3-bucket-name=<bucket-name> \
    --etcd-s3-access-key=<redacted> \
    --etcd-s3-secret-key=<redacted> \
    --etcd-snapshot-schedule-cron='* */1 * * *' \
    --etcd-snapshot-retention=2