Skip to content

Instantly share code, notes, and snippets.

@angrycub
Created March 19, 2018 16:27
Show Gist options
  • Save angrycub/60d02b312735581275e8260997ccd064 to your computer and use it in GitHub Desktop.
Save angrycub/60d02b312735581275e8260997ccd064 to your computer and use it in GitHub Desktop.
Nomad Job Description for Fabio with Consul Registration
job "fabio" {
datacenters = ["dc1"]
type = "system"
update {
stagger = "5s"
max_parallel = 1
}
group "linux-amd64" {
task "fabio" {
constraint {
attribute = "${attr.cpu.arch}"
operator = "="
value = "amd64"
}
constraint {
attribute = "${attr.kernel.name}"
operator = "="
value = "linux"
}
driver = "exec"
config { command = "fabio-1.5.2-go1.8.3-linux_amd64" }
artifact {
source = "https://github.com/fabiolb/fabio/releases/download/v1.5.2/fabio-1.5.2-go1.8.3-linux_amd64"
}
resources {
network {
port "http" {static=9999}
port "ui" {static=9998}
}
}
service {
tags = ["fabio", "lb"]
port = "ui"
check {
name = "fabio ui port is alive"
type = "tcp"
interval = "10s"
timeout = "2s"
}
check {
name = "fabio health check"
type = "http"
path = "/health"
interval = "10s"
timeout = "2s"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment