From 0b3332fd3234a13fc5d780f94a74133d1e7ba199 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 21 Apr 2023 11:55:24 +0200 Subject: break out core services into separate files --- cluster/prod/app/core/deploy/bottin.hcl | 100 ++++++++++ cluster/prod/app/core/deploy/core-service.hcl | 64 ------- cluster/prod/app/core/deploy/core-system.hcl | 257 -------------------------- cluster/prod/app/core/deploy/d53.hcl | 64 +++++++ cluster/prod/app/core/deploy/diplonat.hcl | 68 +++++++ cluster/prod/app/core/deploy/tricot.hcl | 109 +++++++++++ 6 files changed, 341 insertions(+), 321 deletions(-) create mode 100644 cluster/prod/app/core/deploy/bottin.hcl delete mode 100644 cluster/prod/app/core/deploy/core-service.hcl delete mode 100644 cluster/prod/app/core/deploy/core-system.hcl create mode 100644 cluster/prod/app/core/deploy/d53.hcl create mode 100644 cluster/prod/app/core/deploy/diplonat.hcl create mode 100644 cluster/prod/app/core/deploy/tricot.hcl (limited to 'cluster/prod/app') diff --git a/cluster/prod/app/core/deploy/bottin.hcl b/cluster/prod/app/core/deploy/bottin.hcl new file mode 100644 index 0000000..40bb5af --- /dev/null +++ b/cluster/prod/app/core/deploy/bottin.hcl @@ -0,0 +1,100 @@ +job "core:bottin" { + datacenters = ["orion", "neptune", "scorpio"] + type = "system" + priority = 90 + + update { + max_parallel = 1 + stagger = "1m" + } + + group "bottin" { + constraint { + distinct_property = "${meta.site}" + value = "1" + } + + network { + port "ldap_port" { + static = 389 + to = 389 + } + } + + task "bottin" { + driver = "docker" + config { + image = "dxflrs/bottin:7h18i30cckckaahv87d3c86pn4a7q41z" + network_mode = "host" + readonly_rootfs = true + ports = [ "ldap_port" ] + volumes = [ + "secrets/config.json:/config.json", + "secrets:/etc/bottin", + ] + } + + restart { + interval = "5m" + attempts = 10 + delay = "15s" + mode = "delay" + } + + resources { + memory = 100 + memory_max = 200 + } + + template { + data = file("../config/bottin/config.json.tpl") + destination = "secrets/config.json" + } + + template { + data = "{{ key \"secrets/consul/consul.crt\" }}" + destination = "secrets/consul.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 = < Date: Fri, 21 Apr 2023 12:03:35 +0200 Subject: Diplonat on bespin, ipv6-only --- cluster/prod/app/core/deploy/diplonat.hcl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cluster/prod/app') diff --git a/cluster/prod/app/core/deploy/diplonat.hcl b/cluster/prod/app/core/deploy/diplonat.hcl index bf56fd5..d6f8423 100644 --- a/cluster/prod/app/core/deploy/diplonat.hcl +++ b/cluster/prod/app/core/deploy/diplonat.hcl @@ -1,5 +1,5 @@ job "core:diplonat" { - datacenters = ["orion", "neptune", "scorpio"] + datacenters = ["orion", "neptune", "scorpio", "bespin"] type = "system" priority = 90 @@ -53,6 +53,9 @@ DIPLONAT_CONSUL_URL=https://consul.service.prod.consul:8501 DIPLONAT_CONSUL_TLS_SKIP_VERIFY=true DIPLONAT_CONSUL_CLIENT_CERT=/etc/diplonat/consul-client.crt DIPLONAT_CONSUL_CLIENT_KEY=/etc/diplonat/consul-client.key +{{ if env "meta.site" | eq "bespin" }} +DIPLONAT_IPV6_ONLY=true +{{ end }} RUST_LOG=debug EOH destination = "secrets/env" -- cgit v1.2.3 From 607add3161f9a465fc061cfd3a5434aa4dbd4796 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 21 Apr 2023 14:36:10 +0200 Subject: make specifying an ipv6 fully optionnal --- cluster/prod/app/garage/config/garage.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cluster/prod/app') diff --git a/cluster/prod/app/garage/config/garage.toml b/cluster/prod/app/garage/config/garage.toml index 36daa5d..5b10707 100644 --- a/cluster/prod/app/garage/config/garage.toml +++ b/cluster/prod/app/garage/config/garage.toml @@ -6,8 +6,10 @@ db_engine = "lmdb" replication_mode = "3" -rpc_bind_addr = "[{{ env "meta.public_ipv6" }}]:3901" -rpc_public_addr = "[{{ env "meta.public_ipv6" }}]:3901" +{{ with $a := env "attr.unique.hostname" | printf "diplonat/autodiscovery/ipv6/%s" | key | parseJSON }} +rpc_bind_addr = "[{{ $a.address }}]:3901" +rpc_public_addr = "[{{ $a.address }}]:3901" +{{ end }} rpc_secret = "{{ key "secrets/garage/rpc_secret" | trimSpace }}" [consul_discovery] -- cgit v1.2.3 From 258d27c566c78dfc714079bf921270a71fdc9535 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 9 May 2023 15:12:03 +0200 Subject: deploy tricot at bespin, register gitea (not accessed yet) --- cluster/prod/app/core/deploy/tricot.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cluster/prod/app') diff --git a/cluster/prod/app/core/deploy/tricot.hcl b/cluster/prod/app/core/deploy/tricot.hcl index 7c955d2..7c3bada 100644 --- a/cluster/prod/app/core/deploy/tricot.hcl +++ b/cluster/prod/app/core/deploy/tricot.hcl @@ -1,5 +1,5 @@ job "core:tricot" { - datacenters = ["orion", "neptune", "scorpio"] + datacenters = ["orion", "neptune", "scorpio", "bespin"] type = "system" priority = 90 -- cgit v1.2.3