2018-12-17 18:29:56 +00:00
|
|
|
job "r1" {
|
|
|
|
datacenters = ["dc1", "dc2"]
|
2019-10-11 12:00:05 +00:00
|
|
|
type = "service"
|
|
|
|
|
2019-11-25 18:31:00 +00:00
|
|
|
constraint {
|
|
|
|
attribute = "${attr.kernel.name}"
|
|
|
|
value = "linux"
|
|
|
|
}
|
|
|
|
|
2018-12-17 18:29:56 +00:00
|
|
|
spread {
|
2019-10-11 12:00:05 +00:00
|
|
|
attribute = "${node.datacenter}"
|
|
|
|
weight = 100
|
2018-12-17 18:29:56 +00:00
|
|
|
}
|
2019-10-11 12:00:05 +00:00
|
|
|
|
2018-12-17 18:29:56 +00:00
|
|
|
group "test1" {
|
|
|
|
count = 10
|
2019-10-11 12:00:05 +00:00
|
|
|
|
2018-12-17 18:29:56 +00:00
|
|
|
spread {
|
2019-10-11 12:00:05 +00:00
|
|
|
attribute = "${meta.rack}"
|
|
|
|
weight = 100
|
|
|
|
|
2018-12-17 18:29:56 +00:00
|
|
|
target "r1" {
|
|
|
|
percent = 70
|
|
|
|
}
|
2019-10-11 12:00:05 +00:00
|
|
|
|
2018-12-17 18:29:56 +00:00
|
|
|
target "r2" {
|
|
|
|
percent = 30
|
|
|
|
}
|
|
|
|
}
|
2019-10-11 12:00:05 +00:00
|
|
|
|
2018-12-17 18:29:56 +00:00
|
|
|
task "test" {
|
|
|
|
driver = "raw_exec"
|
|
|
|
|
|
|
|
config {
|
|
|
|
command = "bash"
|
|
|
|
args = ["-c", "sleep 15000"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-11 12:00:05 +00:00
|
|
|
}
|