2020-01-06 17:48:35 +00:00
|
|
|
job "multi-service" {
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
|
|
|
constraint {
|
|
|
|
attribute = "${attr.kernel.name}"
|
|
|
|
value = "linux"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "test" {
|
|
|
|
network {
|
|
|
|
mode = "bridge"
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "echo1"
|
|
|
|
port = "9001"
|
|
|
|
|
|
|
|
connect {
|
|
|
|
sidecar_service {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task "echo1" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "hashicorp/http-echo"
|
2020-01-29 18:55:14 +00:00
|
|
|
args = ["-listen=:9001", "-text=echo1"]
|
2020-01-06 17:48:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "echo2"
|
|
|
|
port = "9002"
|
|
|
|
|
|
|
|
connect {
|
|
|
|
sidecar_service {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task "echo2" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "hashicorp/http-echo"
|
2020-01-29 18:55:14 +00:00
|
|
|
args = ["-listen=:9002", "-text=echo2"]
|
2020-01-06 17:48:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|