Documentation
¶
Overview ¶
Package backup contains backup operations against etcd.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backup ¶
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.
Example ¶
Shows how to back up a Kubernetes cluster by specifying the underlying etcd. It assumes that the etcd process is servering on 127.0.0.1:2379.
// define the URL etcd is available at: etcdurl := "http://127.0.0.1:2379" // using Minio play, a public S3-compatible sandbox // for the remote storage available at https://play.minio.io:9000 // 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", "play.minio.io:9000", "2017-07-some-bucket") if err != nil { log.Fatal(err) return } fmt.Printf("The backup completed successfully with ID %s\n", backupid)
Output: The backup completed successfully with ID 1498847078
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.