Skip to content

Instantly share code, notes, and snippets.

@jolexa
Created February 5, 2019 20:53
Show Gist options
  • Save jolexa/5e0a20628fbe324b93b58979107d88df to your computer and use it in GitHub Desktop.
Save jolexa/5e0a20628fbe324b93b58979107d88df to your computer and use it in GitHub Desktop.
Example Nomad Job file
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