a9991e9ab9
Adds 2 tests around Connect Native. Both make use of the example connect native services in https://github.com/hashicorp/nomad-connect-examples One of them runs without Consul ACLs enabled, the other with.
71 lines
1 KiB
HCL
71 lines
1 KiB
HCL
job "cn-demo" {
|
|
datacenters = ["dc1"]
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
group "generator" {
|
|
network {
|
|
port "api" {}
|
|
}
|
|
|
|
service {
|
|
name = "uuid-api"
|
|
port = "${NOMAD_PORT_api}"
|
|
task = "generate"
|
|
|
|
connect {
|
|
native = true
|
|
}
|
|
}
|
|
|
|
task "generate" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
image = "hashicorpnomad/uuid-api:v1"
|
|
network_mode = "host"
|
|
}
|
|
|
|
env {
|
|
BIND = "0.0.0.0"
|
|
PORT = "${NOMAD_PORT_api}"
|
|
}
|
|
}
|
|
}
|
|
|
|
group "frontend" {
|
|
network {
|
|
port "http" {
|
|
static = 9800
|
|
}
|
|
}
|
|
|
|
service {
|
|
name = "uuid-fe"
|
|
port = "9800"
|
|
task = "frontend"
|
|
|
|
connect {
|
|
native = true
|
|
}
|
|
}
|
|
|
|
task "frontend" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
image = "hashicorpnomad/uuid-fe:v1"
|
|
network_mode = "host"
|
|
}
|
|
|
|
env {
|
|
UPSTREAM = "uuid-api"
|
|
BIND = "0.0.0.0"
|
|
PORT = "9800"
|
|
}
|
|
}
|
|
}
|
|
} |