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

K0s backup #835

Merged
merged 12 commits into from
Apr 29, 2021
Merged

K0s backup #835

merged 12 commits into from
Apr 29, 2021

Conversation

trawler
Copy link
Contributor

@trawler trawler commented Apr 12, 2021

Issue
Fixes #204

What this PR Includes
This PR adds a k0s backup command that:

  1. Backs up etcd data (etcd snapshots) in etcd clusters.
  2. Runs a hot backup of Sqlite Dbs in Kine clusters, by using rqlite/rqlite and go-sqlite3
  3. Add a restore command that untars a backup file and restores the cluster.

Task List:

  • Add etcd backup
  • Sqlite backup + certificates
  • Add a Dockerfile to compile k0s in a golang:1.15-alpine image to support cross-compliation of go-sqlite3 (see: Cross compiling fails mattn/go-sqlite3#384)
  • Update smoke tests with the new build option.
  • Test and create a restore command.
  • Docs

@mikhail-sakhnov mikhail-sakhnov force-pushed the k0s_backup branch 2 times, most recently from 8d3200f to 91e6155 Compare April 22, 2021 06:59
@mikhail-sakhnov mikhail-sakhnov marked this pull request as ready for review April 26, 2021 19:16
@mikhail-sakhnov mikhail-sakhnov requested a review from a team as a code owner April 26, 2021 19:16
Copy link
Member

@jnummelin jnummelin left a comment

Choose a reason for hiding this comment

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

Some minor changes requested. Overall pretty good stuff 🙌

@jnummelin
Copy link
Member

Overall this is good stuff.

The only thing on "high-level" I'm bit disliking (and having done some of the work myself, I'm partially to blame too 😄 ) is the fact that we now have to do lot of file/dir copying during the backup and restore. I think it would make sense, at least to try, to rather do "in-place" operations for the various files. Currently this basically means double disk usage for a while for the backup. Might be problematic in resource constrained environments.

The above can be refactored, if it's even doable, in a separate PR though.

@mikhail-sakhnov mikhail-sakhnov force-pushed the k0s_backup branch 2 times, most recently from 7e29a60 to dcd9206 Compare April 27, 2021 07:03
jnummelin
jnummelin previously approved these changes Apr 28, 2021
@jnummelin
Copy link
Member

Separate issue to track the kine/sqlite backup capability at #863

Karen Almog and others added 12 commits April 28, 2021 12:11
Signed-off-by: Karen Almog <kalmog@mirantis.com>
Signed-off-by: Karen Almog <kalmog@mirantis.com>
…lated issues

Added restore command and smoke test

Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
Signed-off-by: Jussi Nummelin <jnummelin@mirantis.com>
Signed-off-by: Mikhail Sakhnov <msakhnov@mirantis.com>
Signed-off-by: Mikhail Sakhnov <msakhnov@mirantis.com>
…and deployments after restore

Signed-off-by: Mikhail Sakhnov <msakhnov@mirantis.com>
… backup-restore process

Signed-off-by: Mikhail Sakhnov <msakhnov@mirantis.com>
Signed-off-by: Mikhail Sakhnov <msakhnov@mirantis.com>
Co-authored-by: Jussi Nummelin <jnummelin@users.noreply.github.com>
Signed-off-by: Mikhail Sakhnov <msakhnov@mirantis.com>
… link to mkdocs.yml

Signed-off-by: Mikhail Sakhnov <msakhnov@mirantis.com>
@mikhail-sakhnov mikhail-sakhnov merged commit 7e67d6b into k0sproject:main Apr 29, 2021
@trawler trawler deleted the k0s_backup branch August 16, 2022 12:47
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.

Cluster backup
4 participants