Created
November 11, 2019 22:01
-
-
Save akhenakh/9769c41fa1912dd4ff4026f94e37a007 to your computer and use it in GitHub Desktop.
Example Nomad deployment
This file contains hidden or 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 "mapd" { | |
datacenters = ["dc1"] | |
type = "service" | |
constraint { | |
operator = "distinct_hosts" | |
value = "true" | |
} | |
update { | |
max_parallel = 1 | |
min_healthy_time = "10s" | |
healthy_deadline = "3m" | |
progress_deadline = "10m" | |
auto_revert = false | |
canary = 0 | |
} | |
migrate { | |
max_parallel = 1 | |
health_check = "checks" | |
min_healthy_time = "10s" | |
healthy_deadline = "5m" | |
} | |
group "mapd" { | |
count = 2 | |
restart { | |
attempts = 3 | |
interval = "1m" | |
delay = "5s" | |
mode = "fail" | |
} | |
volume "tiles" { | |
type = "host" | |
source = "tiles" | |
} | |
task "mapd" { | |
driver = "docker" | |
config { | |
image = "rk0.privdocker:5000/mapd:9e287b5" | |
port_map { | |
http = 9201 | |
metrics = 8888 | |
} | |
} | |
env { | |
"TILESPATH" = "/data/planet11.mbtiles" | |
"TILESURL" = "https://map.dev.mydomain" | |
"KEY" = "mykey" | |
"ALLOWORIGIN" = "*" | |
} | |
volume_mount { | |
volume = "tiles" | |
destination = "/data" | |
read_only = true | |
} | |
resources { | |
cpu = 400 | |
memory = 128 | |
network { | |
mbits = 10 | |
port "http" {} | |
port "metrics" {} | |
} | |
} | |
service { | |
name = "mapd" | |
tags = [ | |
"global", | |
"vuta", | |
"traefik.tags=service", | |
"traefik.frontend.rule=Host:map.dev.mydomain", | |
] | |
port = "http" | |
check { | |
name = "alive" | |
type = "http" | |
path = "/" | |
interval = "10s" | |
timeout = "2s" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment