-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathnomad.jobspec
60 lines (53 loc) · 1.51 KB
/
nomad.jobspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Example Nomad jobspec for consul-snapshot
job "consul-snapshot" {
# Job should run in the US region
region = "us"
# Spread tasks between us-west-1 and us-east-1
datacenters = ["us-west-1", "us-east-1"]
# run this job globally
type = "service"
# Rolling updates should be sequential
update {
stagger = "30s"
max_parallel = 1
}
group "backups" {
# We want 1 backup server
count = 1
# Create a web front end using a docker image
task "backup" {
driver = "exec"
config {
command = "consul-snapshot"
args = ["backup"]
}
service {
port = "http"
check {
type = "http"
path = "/health"
interval = "10s"
timeout = "2s"
}
}
env {
S3BUCKET = "lookmomimbackingupmyconsul"
S3REGION = "us-east-1"
AWS_ACCESS_KEY_ID = "AK1234567890"
AWS_SECRET_ACCESS_KEY = "8idsufpa0udfp8apdf98afd"
BACKUPINTERVAL = 300
}
resources {
cpu = 500
memory = 1024
network {
mbits = 100
# Request for a dynamic port
port "http" {
static = 5001
}
}
}
}
}
}