reshifter: Index | Examples | Files

package backup

import ""

Package backup contains backup operations against etcd.



Package Files

backup.go doc.go strategy.go

func Backup Uses

func Backup(endpoint, target, remote, bucket string) (string, error)

Backup iterates over well-known Kubernetes (distro) keys in an etcd server and creates a ZIP archive of the content in the target directory. On success, it returns the backup ID, which is the Unix time encoded point in time the backup operation was started, for example 1498050161. If remote and bucket is provided, the backup will be additional stored in this S3-compatible object store.

Shows how to back up a Kubernetes cluster by specifying the underlying etcd. It assumes that the etcd process is servering on


// define the URL etcd is available at:
etcdurl := ""

// using Minio play, a public S3-compatible sandbox
// for the remote storage available at
// and the following credentials which need to be exposed
// as environment variables to the ReShifter process:
_ = os.Setenv("ACCESS_KEY_ID", "Q3AM3UQ867SPQQA43P2F")
_ = os.Setenv("SECRET_ACCESS_KEY", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")

// carry out the backup of etcd underlying the Kubernetes cluster
// and handle errors as they occur:
backupid, err := Backup(etcdurl, "/tmp", "", "2017-07-some-bucket")
if err != nil {
fmt.Printf("The backup completed successfully with ID %s\n", backupid)


The backup completed successfully with ID 1498847078

func List Uses

func List(remote, bucket string) ([]string, error)

List generates a list of available backup IDs. If remote and bucket is provided, the S3-compatible object store will be queried rather than the local work directory.

Package backup imports 17 packages (graph) and is imported by 2 packages. Updated 2019-01-10. Refresh now. Tools for package owners.