Last active
April 24, 2020 17:42
-
-
Save eveld/a47b9291dcf25c0e77a8ca9b99564c99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "api" { | |
datacenters = ["ian-esxi-tst"] | |
type = "service" | |
group "api" { | |
count = 1 | |
network { | |
mode = "bridge" | |
port "http" { | |
to = 9090 | |
static = 20345 | |
} | |
} | |
service { | |
name = "api" | |
port = "9090" | |
connect { | |
sidecar_service { | |
proxy { | |
upstreams { | |
destination_name = "database" | |
local_bind_port = 5432 | |
} | |
} | |
} | |
} | |
} | |
task "api" { | |
driver = "docker" | |
config { | |
image = "nicholasjackson/fake-service:v0.9.0" | |
} | |
env { | |
NAME = "api" | |
MESSAGE = "ok" | |
LISTEN_ADDR = "0.0.0.0:9090" | |
UPSTREAM_URIS = "http://localhost:5432" | |
TIMING_VARIANCE = "25" | |
HTTP_CLIENT_KEEP_ALIVES = "true" | |
} | |
resources { | |
cpu = 100 | |
memory = 256 | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "database" { | |
datacenters = ["ian-esxi-tst"] | |
type = "service" | |
group "database" { | |
count = 1 | |
network { | |
mode = "bridge" | |
} | |
service { | |
name = "database" | |
port = "5432" | |
connect { | |
sidecar_service {} | |
} | |
} | |
task "database" { | |
driver = "docker" | |
config { | |
image = "nicholasjackson/fake-service:v0.9.0" | |
} | |
env { | |
NAME = "database" | |
MESSAGE = "ok" | |
LISTEN_ADDR = "0.0.0.0:5432" | |
TIMING_VARIANCE = "25" | |
HTTP_CLIENT_KEEP_ALIVES = "true" | |
} | |
resources { | |
cpu = 100 | |
memory = 256 | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "gateway-cloud" { | |
datacenters = ["cloud"] | |
region = "cloud" | |
type = "service" | |
group "gateways" { | |
count = 1 | |
network { | |
mode = "bridge" | |
port "https" { | |
static = 443 | |
to = 443 | |
} | |
} | |
constraint { | |
operator = "distinct_hosts" | |
value = "true" | |
} | |
task "gateway" { | |
driver = "docker" | |
env { | |
CONSUL_HTTP_ADDR="${attr.unique.network.ip-address}:8500" | |
CONSUL_GRPC_ADDR="${attr.unique.network.ip-address}:8502" | |
} | |
config { | |
image = "nicholasjackson/consul-envoy:v1.7.2-v0.14.1" | |
command = "consul" | |
args = [ | |
"connect", "envoy", | |
"-mesh-gateway", | |
"-register", | |
"-wan-address", "192.168.10.100:443", | |
"--", | |
"-l", "debug" | |
] | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "gateway-onprem" { | |
datacenters = ["onprem"] | |
region = "onprem" | |
type = "service" | |
group "gateways" { | |
count = 1 | |
network { | |
mode = "bridge" | |
port "https" { | |
static = 443 | |
to = 443 | |
} | |
} | |
constraint { | |
operator = "distinct_hosts" | |
value = "true" | |
} | |
task "gateway" { | |
driver = "docker" | |
env { | |
CONSUL_HTTP_ADDR="${attr.unique.network.ip-address}:8500" | |
CONSUL_GRPC_ADDR="${attr.unique.network.ip-address}:8502" | |
} | |
config { | |
image = "nicholasjackson/consul-envoy:v1.7.2-v0.14.1" | |
command = "consul" | |
args = [ | |
"connect", "envoy", | |
"-mesh-gateway", | |
"-register", | |
"-wan-address", "192.168.5.100:443", | |
"--", | |
"-l", "debug" | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment