46 lines
750 B
HCL
46 lines
750 B
HCL
job "consul-test-warden" {
|
|
datacenters = ["dc1"]
|
|
type = "service"
|
|
|
|
constraint {
|
|
attribute = "${node.unique.name}"
|
|
value = "bj-warden"
|
|
}
|
|
|
|
group "consul" {
|
|
count = 1
|
|
|
|
network {
|
|
port "http" {
|
|
static = 8500
|
|
}
|
|
}
|
|
|
|
task "consul" {
|
|
driver = "exec"
|
|
|
|
config {
|
|
command = "consul"
|
|
args = ["agent", "-dev", "-client=0.0.0.0", "-data-dir=/tmp/consul-test"]
|
|
}
|
|
|
|
resources {
|
|
cpu = 200
|
|
memory = 256
|
|
}
|
|
|
|
service {
|
|
name = "consul-test"
|
|
port = "http"
|
|
|
|
check {
|
|
type = "http"
|
|
path = "/v1/status/leader"
|
|
port = "http"
|
|
interval = "10s"
|
|
timeout = "2s"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |