Deploy core on neptune as well

This commit is contained in:
Alex 2021-12-08 11:41:07 +01:00
parent fff6f1db20
commit 8846421cc4
No known key found for this signature in database
GPG key ID: EDABF9711E244EB1
3 changed files with 60 additions and 40 deletions

View file

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

View file

@ -19,5 +19,5 @@ api_bind_addr = "[::]:3990"
[s3_web] [s3_web]
bind_addr = "[::]:3992" bind_addr = "[::]:3992"
root_domain = ".web-staging.deuxfleurs.fr" root_domain = ".garage-staging-web.home.adnab.me"
index = "index.html" index = "index.html"

View file

@ -56,9 +56,7 @@ job "garage-staging" {
service { service {
tags = [ tags = [
"garage-staging-api", "garage-staging-api",
"traefik.enable=true", "tricot garage-staging.home.adnab.me",
"traefik.frontend.entryPoints=https,http",
"traefik.frontend.rule=Host:garage-staging.deuxfleurs.fr"
] ]
port = 3990 port = 3990
address_mode = "driver" address_mode = "driver"
@ -96,6 +94,28 @@ job "garage-staging" {
} }
} }
service {
tags = [
"garage-staging-web",
"tricot *.garage-staging-web.home.adnab.me",
]
port = 3992
address_mode = "driver"
name = "garage-staging-web"
check {
type = "tcp"
port = 3992
address_mode = "driver"
interval = "60s"
timeout = "5s"
check_restart {
limit = 3
grace = "90s"
ignore_warnings = false
}
}
}
restart { restart {
interval = "30m" interval = "30m"
attempts = 10 attempts = 10