A simple tool to backup an etcd2 cluster into an AWS S3 bucket.
##Get the code:
go get https://github.com/revinate/etc2s3
##Compile it:
cd $GOPATH/src/github.com/revinate/etcd2s3; go build
##Run it: Required environment variables:
-
AWS_SECRET_ACCESS_KEY
-
AWS_ACCESS_KEY_ID
-
ETCD2S3_BUCKET_NAME
-
ETCD2S3_DATA_DIR - the path to the etcd2 data directory (where the backup utility will start from)
Optional environment variables:
- ETCD2S3_REPEAT_INTERVAL - if set using time.ParseDuration, this will keep the utility running and attempt a backup after each interval. For example, if set to "5m", the backup/ship will run every 5 minutes.
Once these are set with valid values:
./etcd2s3
- remove dependency on "etcdctl"
- remove dependence on disk for backup ("etcdctl backup"...can we stream directly to tar/zipper?)
- use spf13/cobra or some other CLI building tool
- tests!