Skip to content

Instantly share code, notes, and snippets.

@tgross
Created January 6, 2020 21:08
Show Gist options
  • Save tgross/c7ed0688a6af9bd288e6c7d1626e14db to your computer and use it in GitHub Desktop.
Save tgross/c7ed0688a6af9bd288e6c7d1626e14db to your computer and use it in GitHub Desktop.
job "countdash" {
datacenters = ["dc1"]
group "api" {
network {
mode = "bridge"
}
service {
name = "count-api"
port = "9001"
connect {
sidecar_service {}
}
}
task "web" {
driver = "exec"
env {
PORT = "9001"
}
config {
command = "/usr/local/bin/counting-service"
}
}
}
group "dashboard" {
network {
mode = "bridge"
port "http" {
static = 9002
to = 9002
}
}
service {
name = "count-dashboard"
port = "9002"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "count-api"
local_bind_port = 8080
}
}
}
}
}
task "dashboard" {
driver = "exec"
env {
COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_count_api}"
PORT = "9002"
}
config {
command = "/usr/local/bin/dashboard-service"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment