Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release 1.26] Fixed the etcd retention to delete orphaned snapshots based on the date #8189

Merged

Conversation

vitorsavian
Copy link
Member

Proposed Changes

  • Delete the oldest snapshot files inside the node and s3 if the snapshot count is greater than the retention, regardless of the node name.

  • The delete will occur based on the the date in the name of the file.

Types of Changes

Verification

Need to create a cluster with etcd snapshots enabled and s3

k3s server --cluster-init --etcd-snapshot-schedule-cron "*/1 * * * *" --etcd-snapshot-retention 2 --etcd-s3 --etcd-s3-access-key --etcd-s3-secret-key --etcd-s3-bucket

Then you can see in the /var/lib/rancher/k3s/server/db/snapshots that will maintain the retention

ls /var/lib/rancher/server/db/snapshots

If you are using AWS, you can just reboot the machine to have another name, and just restarted the cluster, it will still delete the snapshot inside /var/lib/rancher/server/db/snapshots and maintain the retention

Testing

Linked Issues

User-Facing Change

NONE

Further Comments

  • This fix was found in the Issue Validations from QA

@vitorsavian vitorsavian requested a review from a team as a code owner August 14, 2023 22:40
@vitorsavian vitorsavian changed the title Fixed the etcd retention to delete orphaned snapshots based on the date [Release 1.26] Fixed the etcd retention to delete orphaned snapshots based on the date Aug 14, 2023
@vitorsavian vitorsavian merged commit 15e0eac into k3s-io:release-1.26 Aug 15, 2023
5 checks passed
@vitorsavian vitorsavian deleted the etcd-retention-based-on-name-1.26 branch October 18, 2023 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants