aboutsummaryrefslogtreecommitdiff
path: root/cluster/prod/app/backup/deploy
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-03-20 16:47:22 +0100
committerAlex Auvolat <alex@adnab.me>2023-03-20 16:47:22 +0100
commitb7c4f94ebd9afdf06338e1410f93c7c5ee99f561 (patch)
treefda1403a89e92e842bfda19fe6eecb6510d0664e /cluster/prod/app/backup/deploy
parenteec09724febf398e538a275c7d2f586027839d94 (diff)
downloadnixcfg-b7c4f94ebd9afdf06338e1410f93c7c5ee99f561.tar.gz
nixcfg-b7c4f94ebd9afdf06338e1410f93c7c5ee99f561.zip
Add Garage backup script running on Abricot
Diffstat (limited to 'cluster/prod/app/backup/deploy')
-rw-r--r--cluster/prod/app/backup/deploy/backup-daily.hcl53
1 files changed, 49 insertions, 4 deletions
diff --git a/cluster/prod/app/backup/deploy/backup-daily.hcl b/cluster/prod/app/backup/deploy/backup-daily.hcl
index f3da8aa..fb301e1 100644
--- a/cluster/prod/app/backup/deploy/backup-daily.hcl
+++ b/cluster/prod/app/backup/deploy/backup-daily.hcl
@@ -1,5 +1,5 @@
job "backup_daily" {
- datacenters = ["orion", "neptune"]
+ datacenters = ["orion", "neptune", "scorpio"]
type = "batch"
priority = "60"
@@ -44,7 +44,7 @@ EOH
resources {
cpu = 500
memory = 100
- memory_max = 300
+ memory_max = 1000
}
restart {
@@ -90,7 +90,7 @@ EOH
resources {
cpu = 500
memory = 100
- memory_max = 300
+ memory_max = 1000
}
restart {
@@ -227,7 +227,52 @@ EOH
resources {
cpu = 500
- memory = 200
+ memory = 100
+ memory_max = 1000
+ }
+
+ restart {
+ attempts = 2
+ interval = "30m"
+ delay = "15s"
+ mode = "fail"
+ }
+ }
+ }
+
+ group "backup-garage" {
+ constraint {
+ attribute = "${attr.unique.hostname}"
+ operator = "="
+ value = "abricot"
+ }
+
+ task "main" {
+ driver = "docker"
+
+ config {
+ image = "lxpz/backup_garage:4"
+ network_mode = "host"
+ volumes = [
+ "/mnt/storage/backup/garage.deuxfleurs.fr:/backup"
+ ]
+ }
+
+ template {
+ data = <<EOH
+BACKUP_BASEDIR=/backup
+GARAGE_ADMIN_TOKEN={{ key "secrets/garage/admin_token" }}
+GARAGE_ACCESS_KEY={{ key "secrets/backup/garage/s3_access_key_id" }}
+GARAGE_SECRET_KEY={{ key "secrets/backup/garage/s3_secret_access_key" }}
+EOH
+ destination = "secrets/env_vars"
+ env = true
+ }
+
+ resources {
+ cpu = 500
+ memory = 100
+ memory_max = 1000
}
restart {