diff --git a/cluster/prod/app/directory/config/bottin/config.json.tpl b/cluster/prod/app/core/config/bottin/config.json.tpl similarity index 100% rename from cluster/prod/app/directory/config/bottin/config.json.tpl rename to cluster/prod/app/core/config/bottin/config.json.tpl diff --git a/cluster/prod/app/core/deploy/core.hcl b/cluster/prod/app/core/deploy/core.hcl index 274cb5b..3625993 100644 --- a/cluster/prod/app/core/deploy/core.hcl +++ b/cluster/prod/app/core/deploy/core.hcl @@ -3,13 +3,8 @@ job "core" { type = "system" priority = 90 - constraint { - attribute = "${attr.cpu.arch}" - value = "amd64" - } - update { - max_parallel = 1 + max_parallel = 1 stagger = "1m" } @@ -69,4 +64,170 @@ EOH } } } + + group "tricot" { + constraint { + distinct_property = "${meta.site}" + value = "1" + } + + network { + port "http_port" { static = 80 } + port "https_port" { static = 443 } + } + + task "server" { + driver = "docker" + + config { + image = "lxpz/amd64_tricot:42" + network_mode = "host" + readonly_rootfs = true + ports = [ "http_port", "https_port" ] + volumes = [ + "secrets:/etc/tricot", + ] + } + + resources { + cpu = 2000 + memory = 200 + } + + restart { + interval = "30m" + attempts = 2 + 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 = <