Skip to content

Commit

Permalink
Merge pull request #5 from hashicorp/f-cn-bridge-demo
Browse files Browse the repository at this point in the history
add connect native demo using bridge network
  • Loading branch information
schmichael authored Aug 11, 2020
2 parents a2c7a67 + c51fafc commit 44f44b1
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions connect-native/cn-bridge-demo.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
job "cn-bridge-demo" {
datacenters = ["dc1"]

// Generator uses bridge network unlike cn-demo.nomad
group "generator" {
network {
mode = "bridge"
port "api" {
// nomads choice
}
}

service {
name = "uuid-api"
port = "${NOMAD_PORT_api}"

connect {
native = true
}
}

task "generate" {
driver = "docker"

config {
image = "hashicorpnomad/uuid-api:v3"
}

env {
BIND = "0.0.0.0"
PORT = "${NOMAD_PORT_api}"
}
}
}

// Frontend continues to use host networking like cn-demo.nomad
group "frontend" {
network {
port "http" {
static = 9800
}
}

service {
name = "uuid-fe"
port = "9800"

connect {
native = true
}
}

task "frontend" {
driver = "docker"

config {
image = "hashicorpnomad/uuid-fe:v3"
network_mode = "host"
}

env {
UPSTREAM = "uuid-api"
BIND = "0.0.0.0"
PORT = "9800"
}
}
}
}

0 comments on commit 44f44b1

Please sign in to comment.