2020-05-23 14:50:30 +00:00
|
|
|
job "core" {
|
2021-07-26 20:58:51 +00:00
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "system"
|
|
|
|
priority = 90
|
2020-05-23 14:50:30 +00:00
|
|
|
|
2021-07-26 20:58:51 +00:00
|
|
|
constraint {
|
|
|
|
attribute = "${attr.cpu.arch}"
|
|
|
|
value = "amd64"
|
|
|
|
}
|
2020-05-23 14:50:30 +00:00
|
|
|
|
2021-07-26 20:58:51 +00:00
|
|
|
update {
|
|
|
|
max_parallel = 1
|
|
|
|
stagger = "1m"
|
|
|
|
}
|
2020-05-23 14:50:30 +00:00
|
|
|
|
2021-07-26 20:58:51 +00:00
|
|
|
group "network" {
|
|
|
|
task "diplonat" {
|
|
|
|
driver = "docker"
|
2020-05-23 14:50:30 +00:00
|
|
|
|
2021-07-26 20:58:51 +00:00
|
|
|
config {
|
|
|
|
image = "darkgallium/amd64_diplonat:v2"
|
|
|
|
network_mode = "host"
|
|
|
|
readonly_rootfs = true
|
|
|
|
privileged = true
|
|
|
|
}
|
2020-05-23 14:50:30 +00:00
|
|
|
|
2021-07-26 20:58:51 +00:00
|
|
|
restart {
|
|
|
|
interval = "30m"
|
|
|
|
attempts = 2
|
|
|
|
delay = "15s"
|
|
|
|
mode = "delay"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
2020-05-23 14:50:30 +00:00
|
|
|
DIPLONAT_PRIVATE_IP={{ env "attr.unique.network.ip-address" }}
|
|
|
|
DIPLONAT_REFRESH_TIME=60
|
|
|
|
DIPLONAT_EXPIRATION_TIME=300
|
|
|
|
DIPLONAT_CONSUL_NODE_NAME={{ env "attr.unique.hostname" }}
|
|
|
|
RUST_LOG=debug
|
|
|
|
EOH
|
2021-07-26 20:58:51 +00:00
|
|
|
destination = "secrets/env"
|
|
|
|
env = true
|
|
|
|
}
|
2020-05-23 14:50:30 +00:00
|
|
|
|
2021-07-26 20:58:51 +00:00
|
|
|
resources {
|
|
|
|
memory = 40
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-23 14:50:30 +00:00
|
|
|
}
|