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