Tool for creating etcd backups and uploading them to AWS S3.
Create etcd V2 and V3 backup and upload to S3.
docker run --rm \
-e AWS_REGION=REGION \
-e ETCDBACKUP_AWS_ACCESS_KEY=XXX \
-e ETCDBACKUP_AWS_SECRET_KEY=YYY \
-e ETCDBACKUP_PASSPHRASE=ZZZ \
-v /var/lib/etcd:/var/lib/etcd \
quay.io/giantswarm/etcd-backup \
-aws-s3-bucket bucket \
-prefix cluster1 \
-etcd-v3-endpoints http://172.17.0.1:2379 \
-etcd-v2-datadir /var/lib/etcd
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' .
etcdctlinstalled.- AWS S3 bucket.
- AWS access and secret key with write permissions for this bucket.
etcd-backup -help
Arguments:
aws-s3-bucket - AWS S3 bucket for backups (default: etcdbackups)
aws-s3-region - AWS S3 region for backups (default: us-east-1)
guest-backup - Enable guest clusters etcd backup (default: false)
etcd-v2-datadir - Etcd datadir. If not set V2 etcd will be skipped (default: "")
etcd-v3-cert - Client certificate for etcd connection (default: "")
etcd-v3-cacert - Client CA certificate for etcd connection (default: "")
etcd-v3-key - Client private key for etcd connection (default: "")
etcd-v3-endpoints - Endpoints for etcd connection (default: http://127.0.0.1:2379)
prefix - [mandatory] Prefix to use in etcd filenames (default: "")
provider - [mandatory] provider (aws, azure or kvm) (default: "")
skip-v2 - flag for skipping etcd v2 backup (default: false)
By default tool creates only V3 backup and uploads file to AWS S3.
export ETCDBACKUP_AWS_ACCESS_KEY=XXX
export ETCDBACKUP_AWS_SECRET_KEY=YYY
export ETCDBACKUP_PASSPHRASE=ZZZ
etcd-backup -aws-s3-bucket bucket -prefix cluster1
To create both V2 and V3 make sure etcd data directory accessible locally.
etcd-backup -aws-s3-bucket $BUCKET_NAME -prefix $CLUSTER_NAME -etcd-v2-datadir /var/lib/etcd
To restore backup use following guide as example.
- Implement additional storage backends.
- Mailing list: giantswarm
- IRC: #giantswarm on freenode.org
- Bugs: issues
See CONTRIBUTING.md for details on submitting patches, the contribution workflow as well as reporting bugs.
PROJECT is under the Apache 2.0 license. See the LICENSE file for details.