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

Fix for cluster-reset backup from s3 when etcd snapshots are disabled #8155

Conversation

vitorsavian
Copy link
Member

Proposed Changes

If cluster-reset was called with etcd-disable-snapshots , k3s will verify if the user have etcd-s3 and then restore the snapshot from S3.

Types of Changes

  • Fix

Verification

Create a config.yaml in the /etc/rancher/k3s with this flags

cluster-init: true
etcd-disable-snapshots: true
etcd-s3: true
etcd-s3-access-key: 'secretKey'
etcd-s3-secret-key: 'secretKey'
etcd-s3-bucket: 'bucketName'
etcd-s3-region: 'awsRegion'
etcd-s3-timeout: '90s'

Now you can create the server

k3s server 

Then you need to save the snapshot, that will backup to s3

k3s etcd-snapshot save

Turn off the k3s and then

k3s server --cluster-reset --cluster-reset-restore-path="s3SnapshotName"

Testing

Linked Issues

User-Facing Change


Further Comments

With this change, users can now manage and backup their own snapshots on demand from S3.

@vitorsavian vitorsavian requested a review from a team as a code owner August 7, 2023 20:26
Copy link
Member

@dereknola dereknola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could likely be solved even easier by just changing the original if statement to:

if !cfg.EtcdDisableSnapshots  || cfg.ClusterReset {
}

So we always fill the etcd snapshot values if we see a clusterReset Flag

@vitorsavian vitorsavian changed the title Cluster reset does not backup from s3 when have disabled etcd snapshots Fix for cluster-reset backup from s3 when etcd snapshots are disabled Aug 10, 2023
@vitorsavian vitorsavian merged commit c972118 into k3s-io:master Aug 10, 2023
vitorsavian added a commit to vitorsavian/k3s that referenced this pull request Aug 10, 2023
…k3s-io#8155)

* Fixed when the user disable the etcd snapshots, but want to backup from s3

Signed-off-by: Vitor <[email protected]>
vitorsavian added a commit to vitorsavian/k3s that referenced this pull request Aug 10, 2023
…k3s-io#8155)

* Fixed when the user disable the etcd snapshots, but want to backup from s3

Signed-off-by: Vitor <[email protected]>
vitorsavian added a commit to vitorsavian/k3s that referenced this pull request Aug 10, 2023
…k3s-io#8155)

* Fixed when the user disable the etcd snapshots, but want to backup from s3

Signed-off-by: Vitor <[email protected]>
vitorsavian added a commit that referenced this pull request Aug 10, 2023
…#8155)

* Fixed when the user disable the etcd snapshots, but want to backup from s3

Signed-off-by: Vitor <[email protected]>
vitorsavian added a commit that referenced this pull request Aug 10, 2023
…#8155)

* Fixed when the user disable the etcd snapshots, but want to backup from s3

Signed-off-by: Vitor <[email protected]>
vitorsavian added a commit that referenced this pull request Aug 10, 2023
…#8155)

* Fixed when the user disable the etcd snapshots, but want to backup from s3

Signed-off-by: Vitor <[email protected]>
@vitorsavian vitorsavian deleted the etcd-not-restoring-from-s3-with-etcd-disable-snapshots 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.

3 participants