Skip to content

Commit

Permalink
fix: add affinity to weather job
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Becker <[email protected]>
  • Loading branch information
brucellino committed Apr 24, 2022
1 parent 2849352 commit d98e773
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions weather.nomad
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
job "weather" {

affinity {
attribute = "${attr.unique.hostname}"
value = "inky"
weight = 100
}
constraint {
attribute = "${attr.unique.hostname}"
value = "inky"
Expand All @@ -20,6 +26,11 @@ job "weather" {
datacenters = ["dc1"]

group "weather" {
ephemeral_disk {
migrate = true
size = 100
sticky = true
}
task "weather" {
driver = "raw_exec"

Expand All @@ -32,6 +43,11 @@ job "weather" {
cpu = 256
memory = 128
}

logs {
max_files = 5
max_file_size = 5
}
service {
tags = ["weather"]
// port = "weather"
Expand Down

0 comments on commit d98e773

Please sign in to comment.