Take a backup of a consul database
10K+
Create a backup of a consul database and uploads it to S3, using vault to lease S3 credentials.
Intended to be run through nomad, or some other container scheduler:
job "consul-backup" {
type = "batch"
datacenters = ["dc1"]
task "backup" {
driver = "docker"
config {
image = "beamnetwork/consul-backup:latest"
force_pull = true
}
env {
VAULT_ADDR = "https://127.0.0.1:8200"
BUCKET = "my-backups-bucket"
PREFIX = "consul-backups-prefix"
VAULT_STS_ROLE = "consul-backups-role"
}
resources {
cpu = 500
memory = 512
}
vault {
policies = ["consul-backups"]
}
}
}
The corresponding permissions must exist in the consul-backups vault policy:
path "aws/sts/consul-backups" {
capabilities = ["read"]
}
First, set the required environment variables:
Then you should be able to run the container:
docker run -e "VAULT_ADDR=$VAULT_ADDR" -e "VAULT_TOKEN=$VAULT_TOKEN" -e "VAULT_STS_ROLE=$VAULT_STS_ROLE" -e "BUCKET=$BUCKET" -e "PREFIX=$PREFIX" beamnetwork/consul-backup
PRs accepted.
MIT © Eco Inc. 2020
Content type
Image
Digest
Size
61.6 MB
Last updated
about 6 years ago
docker pull beamnetwork/consul-backup