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

✨ Allow to perform manual ETCD snapshots #856

Merged

Conversation

Danil-Grigorev
Copy link
Contributor

@Danil-Grigorev Danil-Grigorev commented Nov 15, 2024

What this PR does / why we need it:

This PR completes the initial setup of the controller with functionality to create manual snapshots on user demand, using the system-agent and RKE2 cli, following the docs.

This comes with some problems, like inability to specifically name the snapshot and deterministically connect it to the ETCDMachineSnapshot replica, created by the user, but the issue lays in lacking options in k3s/rke2 CLI. In the scenario when the snapshot is named “my-snapshot”, the actual name looks like: local-my-snapshot-rke2-control-plane-mnf8z-1731675906-31aa01 and may easily overlap with a snapshot named as just “snapshot”. (Edit: currently matches against snapshotName and machineName)

This also makes it hard to connect the creationTimestamp of the snapshot on the child cluster with the originally invoked ETCDMachineSnapshot resource execution, as no additional info can be stored on the snapshot instance when calling the CLI. (Edit: storing snapshot timestamp in the list now)

Final snapshot location and other infor is created and is available on the list within the automatic snapshot record (one per cluster).

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #725

Special notes for your reviewer:

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@Danil-Grigorev Danil-Grigorev requested a review from a team as a code owner November 15, 2024 13:35
@Danil-Grigorev Danil-Grigorev added area/etcdsnapshot-restore Categorizes issue or PR as related to Turtles ETCD Snapshot & Restore feature kind/feature labels Nov 15, 2024
Copy link
Member

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

thanks! looks good to me

Copy link
Contributor

@yiannistri yiannistri left a comment

Choose a reason for hiding this comment

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

LGTM

@Danil-Grigorev Danil-Grigorev merged commit f3a4835 into rancher:main Nov 28, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/etcdsnapshot-restore Categorizes issue or PR as related to Turtles ETCD Snapshot & Restore feature kind/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement snapshot controller functionality
4 participants