2023-06-02 13:40:43 +00:00
|
|
|
job "core-tricot" {
|
|
|
|
# bespin pas pour l'instant, on a des soucis de SSL avec gitea
|
|
|
|
# on pourra mettre bespin quand on aura migré gitea de la vm vers le cluster
|
|
|
|
# en attendant, les deux ne sont pas capables de partager les certificats SSL
|
|
|
|
# donc on laisse la VM gitea gérer les certifs et prendre tout le trafic http(s)
|
2024-11-06 23:17:18 +00:00
|
|
|
datacenters = ["corrin", "neptune", "scorpio"]
|
2023-04-21 09:55:24 +00:00
|
|
|
type = "system"
|
|
|
|
priority = 90
|
|
|
|
|
|
|
|
update {
|
|
|
|
max_parallel = 1
|
|
|
|
stagger = "5m"
|
|
|
|
}
|
|
|
|
|
|
|
|
group "tricot" {
|
|
|
|
constraint {
|
|
|
|
distinct_property = "${meta.site}"
|
|
|
|
value = "1"
|
|
|
|
}
|
|
|
|
|
|
|
|
network {
|
|
|
|
port "http_port" { static = 80 }
|
|
|
|
port "https_port" { static = 443 }
|
|
|
|
port "metrics_port" { static = 9334 }
|
|
|
|
}
|
|
|
|
|
|
|
|
task "server" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2024-11-09 22:28:57 +00:00
|
|
|
image = "armael/tricot:n6dk1b5xrdww12zf12jbcmihqs6g1brz"
|
2023-04-21 09:55:24 +00:00
|
|
|
network_mode = "host"
|
|
|
|
readonly_rootfs = true
|
|
|
|
ports = [ "http_port", "https_port" ]
|
|
|
|
volumes = [
|
|
|
|
"secrets:/etc/tricot",
|
|
|
|
]
|
2024-04-25 07:12:50 +00:00
|
|
|
ulimit {
|
|
|
|
nofile = "65535:65535"
|
|
|
|
}
|
2023-04-21 09:55:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 1000
|
|
|
|
memory = 200
|
|
|
|
memory_max = 500
|
|
|
|
}
|
|
|
|
|
|
|
|
restart {
|
|
|
|
interval = "5m"
|
|
|
|
attempts = 10
|
|
|
|
delay = "15s"
|
|
|
|
mode = "delay"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-ca.crt\" }}"
|
|
|
|
destination = "secrets/consul-ca.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.crt\" }}"
|
|
|
|
destination = "secrets/consul-client.crt"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/consul/consul-client.key\" }}"
|
|
|
|
destination = "secrets/consul-client.key"
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
|
|
|
data = <<EOH
|
|
|
|
TRICOT_NODE_NAME={{ env "attr.unique.hostname" }}
|
|
|
|
TRICOT_LETSENCRYPT_EMAIL=prod-sysadmin@deuxfleurs.fr
|
|
|
|
TRICOT_ENABLE_COMPRESSION=true
|
|
|
|
TRICOT_CONSUL_HOST=https://consul.service.prod.consul:8501
|
|
|
|
TRICOT_CONSUL_TLS_SKIP_VERIFY=true
|
|
|
|
TRICOT_CONSUL_CLIENT_CERT=/etc/tricot/consul-client.crt
|
|
|
|
TRICOT_CONSUL_CLIENT_KEY=/etc/tricot/consul-client.key
|
|
|
|
TRICOT_HTTP_BIND_ADDR=[::]:80
|
|
|
|
TRICOT_HTTPS_BIND_ADDR=[::]:443
|
|
|
|
TRICOT_METRICS_BIND_ADDR=[::]:9334
|
2023-08-09 08:40:08 +00:00
|
|
|
TRICOT_WARMUP_CERT_MEMORY_STORE=true
|
2023-04-21 09:55:24 +00:00
|
|
|
RUST_LOG=tricot=debug
|
|
|
|
EOH
|
|
|
|
destination = "secrets/env"
|
|
|
|
env = true
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "tricot-http"
|
|
|
|
port = "http_port"
|
2024-02-14 08:28:31 +00:00
|
|
|
tags = [
|
|
|
|
"(diplonat (tcp_port 80))",
|
|
|
|
"${meta.site}"
|
|
|
|
]
|
2023-04-21 09:55:24 +00:00
|
|
|
address_mode = "host"
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "tricot-https"
|
|
|
|
port = "https_port"
|
|
|
|
tags = [
|
|
|
|
"(diplonat (tcp_port 443))",
|
|
|
|
"${meta.site}",
|
|
|
|
"d53-a global.site.deuxfleurs.fr",
|
|
|
|
"d53-aaaa global.site.deuxfleurs.fr",
|
2024-02-14 08:28:31 +00:00
|
|
|
"d53-a ${meta.site}.site.deuxfleurs.fr",
|
|
|
|
"d53-aaaa ${meta.site}.site.deuxfleurs.fr",
|
|
|
|
"d53-a v4.${meta.site}.site.deuxfleurs.fr",
|
|
|
|
"d53-aaaa v6.${meta.site}.site.deuxfleurs.fr",
|
2023-04-21 09:55:24 +00:00
|
|
|
]
|
|
|
|
address_mode = "host"
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "tricot-metrics"
|
|
|
|
port = "metrics_port"
|
|
|
|
address_mode = "host"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|