Created
February 5, 2019 20:53
-
-
Save jolexa/5e0a20628fbe324b93b58979107d88df to your computer and use it in GitHub Desktop.
Example Nomad Job file
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 "microbot" { | |
region = "global" | |
datacenters = ["nomad-intro"] | |
# Rolling updates | |
update { | |
stagger = "10s" | |
max_parallel = 3 | |
} | |
group "web" { | |
count = 3 | |
task "microbot" { | |
driver = "docker" | |
config { | |
image = "dontrebootme/microbot:v1" | |
port_map { | |
http = 80 | |
} | |
} | |
service { | |
port = "http" | |
check { | |
type = "http" | |
path = "/" | |
interval = "10s" | |
timeout = "2s" | |
} | |
} | |
env { | |
DEMO_NAME = "nomad-intro" | |
} | |
resources { | |
cpu = 100 | |
memory = 32 | |
network { | |
mbits = 100 | |
port "http" {} | |
} | |
} | |
} | |
task "microbot-dash" { | |
driver = "docker" | |
config { | |
image = "dontrebootme/microbot:v1" | |
port_map { | |
http = 80 | |
} | |
} | |
service { | |
port = "http" | |
check { | |
type = "http" | |
path = "/" | |
interval = "10s" | |
timeout = "2s" | |
} | |
} | |
env { | |
DEMO_NAME = "nomad-intro" | |
} | |
resources { | |
cpu = 100 | |
memory = 32 | |
network { | |
mbits = 100 | |
port "http" {} | |
} | |
} | |
} | |
task "tester" { | |
driver = "docker" | |
config { | |
image = "dontrebootme/microbot:v1" | |
port_map { | |
http = 80 | |
} | |
} | |
service { | |
port = "http" | |
check { | |
type = "http" | |
path = "/" | |
interval = "10s" | |
timeout = "2s" | |
} | |
} | |
env { | |
DEMO_NAME = "nomad-intro" | |
micro_task_label = "${NOMAD_ADDR_microbot_http}" | |
micro_dash_task_label = "${NOMAD_ADDR_microbot-dash_http}" | |
micro_underscore_task_label = "${NOMAD_ADDR_microbot_dash_http}" | |
} | |
resources { | |
cpu = 100 | |
memory = 32 | |
network { | |
mbits = 100 | |
port "http" {} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment