reshifter

command module
v0.3.3-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

README

ReShifter

Go Report Card godoc Docker Repository on Quay

A cluster admin backup and restore tool for Kubernetes distros such as OpenShift, using etcd to query and manipulate the state of all objects.

Status and roadmap

See Trello board.

Deploy app locally

If you want to use the ReShifter app, that is the Web UI, you need to use the Docker image since it bundles the static assets such as HTML, CSS, and JS and the Go binary. For example, to launch the ReShifter app locally, do:

$ docker run --rm -p 8080:8080 quay.io/mhausenblas/reshifter:0.3.1

If you want to use the ReShifter API, for example as a head-less service, you can simply use the binary, no other dependencies required:

$ curl -s -L https://github.com/mhausenblas/reshifter/releases/download/v0.3.1-alpha/reshifter -o reshifter
$ chmod +x reshifter
$ ./reshifter

The ReShifter HTTP API is defined in and available via Swagger: swaggerhub.com/apis/mhausenblas/reshifter/1.0.0

Deploy app in OpenShift

Note: requires an OpenShift 1.5 cluster and oc installed, locally.

$ make init
$ make publish

Deploy app in Kubernetes

TBD.

CLI tool

ReShifter also provides for a CLI tool called rcli—get binary releases for Linux and macOS here—with the following signature:

$ rcli -h
A CLI for ReShifter, supports backing up and restoring Kubernetes clusters.

Usage:
  rcli [command]

Available Commands:
  backup      Creates a backup of a Kubernetes cluster
  explore     Probes an etcd endpoint
  help        Help about any command
  restore     Performs a restore of a Kubernetes cluster
  version     Displays the ReShifter version

Here's a simple usage example which assumes that you've got a Kubernetes cluster with an etcd on http://localhost:4001 running:

# explore the endpoint, overwrite default:
$ rcli explore -e http://localhost:4001

# back up to Minio playground:
$ ACCESS_KEY_ID=Q3AM3UQ867SPQQA43P2F \
  SECRET_ACCESS_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG \
  rcli/rcli backup -e http://localhost:4001 -r play.minio.io:9000 -b mh9-test

# restart/empty etcd now

# restore from Minio playground, using backup ID 1498815551
$ ACCESS_KEY_ID=Q3AM3UQ867SPQQA43P2F \
  SECRET_ACCESS_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG \
  rcli/rcli restore -e http://localhost:4001 -r play.minio.io:9000 -b mh9-test -i 1498815551

Test and development

See the pages for testbed and development.

Documentation

Overview

ReShifter enables backing up and restoring OpenShift clusters. The ReShifter app launches an API and a UI at port 8080. The API is instrumented, exposing Prometheus metrics. When launching the app with the defaults, the backups are created in the current directory and the temporary work files are placed in the /tmp directory.

Directories

Path Synopsis
pkg
backup
Package backup contains backup operations against etcd.
Package backup contains backup operations against etcd.
discovery
Package discovery contains functionality to discover the type of etcd used in back up and restore operations as well as what Kubernetes distro is used.
Package discovery contains functionality to discover the type of etcd used in back up and restore operations as well as what Kubernetes distro is used.
remotes
Package remotes contains operations to store and retrieve backups in remote storage locations such as Amazon S3.
Package remotes contains operations to store and retrieve backups in remote storage locations such as Amazon S3.
restore
Package restore contains restore operations against etcd.
Package restore contains restore operations against etcd.
types
Package types defines types and constants used in the ReShifter lib.
Package types defines types and constants used in the ReShifter lib.
util
Package util contains various helper functions for ReShifter.
Package util contains various helper functions for ReShifter.
cmd
Package cmd implements the ReShifter CLI tools.
Package cmd implements the ReShifter CLI tools.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL