Skip to content

Commit

Permalink
add nomad demo part3
Browse files Browse the repository at this point in the history
  • Loading branch information
bigwhite committed Apr 20, 2019
1 parent 5d7163a commit 485ab88
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
15 changes: 15 additions & 0 deletions nomad-demo/part3/agent-weave-proxy-mode.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
data_dir = "/root/nomad-install/nomad.d"

bind_addr = "192.168.56.3"

server {
enabled = true
bootstrap_expect = 3
}

client {
enabled = true
options {
docker.endpoint = "unix:///var/run/weave/weave.sock"
}
}
12 changes: 12 additions & 0 deletions nomad-demo/part3/agent.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
data_dir = "/root/nomad-install/nomad.d"

bind_addr = "192.168.56.3"

server {
enabled = true
bootstrap_expect = 3
}

client {
enabled = true
}
34 changes: 34 additions & 0 deletions nomad-demo/part3/httpbackend-another-subnet.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
job "httpbackend" {
datacenters = ["dc1"]
type = "service"

group "httpbackend" {
count = 3

task "httpbackend" {
driver = "docker"
config {
image = "bigwhite/httpbackendservice:v1.0.0"
dns_servers = ["192.168.56.3", "192.168.56.4", "192.168.56.5"]
logging {
type = "json-file"
}
}

env {
WEAVE_CIDR="net:10.32.1.0/24"
}

resources {
network {
mbits = 10
}
}

service {
name = "httpbackend"
address_mode = "driver"
}
}
}
}
30 changes: 30 additions & 0 deletions nomad-demo/part3/httpbackend.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
job "httpbackend" {
datacenters = ["dc1"]
type = "service"

group "httpbackend" {
count = 3

task "httpbackend" {
driver = "docker"
config {
image = "bigwhite/httpbackendservice:v1.0.0"
dns_servers = ["192.168.56.3", "192.168.56.4", "192.168.56.5"]
network_mode = "weave"
logging {
type = "json-file"
}
}

resources {
network {
mbits = 10
}
}

service {
name = "httpbackend"
}
}
}
}

0 comments on commit 485ab88

Please sign in to comment.