52 lines
837 B
HCL
52 lines
837 B
HCL
job "simple-consul-test" {
|
|
datacenters = ["dc1"]
|
|
type = "service"
|
|
|
|
constraint {
|
|
attribute = "${node.unique.name}"
|
|
value = "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",
|
|
"-bind=100.122.197.112",
|
|
"-data-dir=/tmp/consul-test-data"
|
|
]
|
|
}
|
|
|
|
resources {
|
|
cpu = 200
|
|
memory = 256
|
|
}
|
|
|
|
service {
|
|
name = "consul-test"
|
|
port = "http"
|
|
|
|
check {
|
|
type = "http"
|
|
path = "/v1/status/leader"
|
|
port = "http"
|
|
interval = "10s"
|
|
timeout = "2s"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |