diff options
author | Alex Auvolat <alex@adnab.me> | 2022-08-24 15:42:47 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-08-24 15:42:47 +0200 |
commit | 2e8923b383eb06c53261eee8e5c442b857fb67e4 (patch) | |
tree | 0ad148f75f7b54dfed2dbac8f43f6df9badc502a /app/garage-staging | |
parent | 9848f3090f77363a2fda0f9fa673ebcf1fb8228c (diff) | |
download | nixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.tar.gz nixcfg-2e8923b383eb06c53261eee8e5c442b857fb67e4.zip |
Move app files into cluster subdirectories; add prod garage
Diffstat (limited to 'app/garage-staging')
-rw-r--r-- | app/garage-staging/config/garage.toml | 31 | ||||
-rw-r--r-- | app/garage-staging/deploy/garage.hcl | 195 | ||||
-rw-r--r-- | app/garage-staging/secrets/garage-staging/rpc_secret | 1 |
3 files changed, 0 insertions, 227 deletions
diff --git a/app/garage-staging/config/garage.toml b/app/garage-staging/config/garage.toml deleted file mode 100644 index 60ab797..0000000 --- a/app/garage-staging/config/garage.toml +++ /dev/null @@ -1,31 +0,0 @@ -block_size = 1048576 - -metadata_dir = "/meta" -data_dir = "/data" - -replication_mode = "3" - -rpc_bind_addr = "0.0.0.0:3991" -rpc_secret = "{{ key "secrets/garage-staging/rpc_secret" | trimSpace }}" - -#consul_host = "localhost:8500" -#consul_service_name = "garage-staging-rpc-self-advertised" - -bootstrap_peers = [] - -[s3_api] -s3_region = "garage-staging" -api_bind_addr = "0.0.0.0:3990" - -[k2v_api] -api_bind_addr = "0.0.0.0:3993" - -[s3_web] -bind_addr = "0.0.0.0:3992" -root_domain = ".web.staging.deuxfleurs.org" -index = "index.html" - -[admin] -api_bind_addr = "0.0.0.0:3909" -admin_token = "{{ key "secrets/garage-staging/admin_token" | trimSpace }}" -trace_sink = "http://{{ env "attr.unique.network.ip-address" }}:4317" diff --git a/app/garage-staging/deploy/garage.hcl b/app/garage-staging/deploy/garage.hcl deleted file mode 100644 index a1907d4..0000000 --- a/app/garage-staging/deploy/garage.hcl +++ /dev/null @@ -1,195 +0,0 @@ -job "garage-staging" { - type = "system" - #datacenters = [ "neptune", "pluton" ] - datacenters = [ "neptune" ] - - priority = 80 - - constraint { - attribute = "${attr.cpu.arch}" - value = "amd64" - } - - group "garage-staging" { - network { - port "s3" { static = 3990 } - port "rpc" { static = 3991 } - port "web" { static = 3992 } - port "k2v" { static = 3993 } - port "admin" { static = 3909 } - } - - update { - max_parallel = 1 - min_healthy_time = "30s" - healthy_deadline = "5m" - } - - # task "repair" { - # lifecycle { - # hook = "prestart" - # sidecar = false - # } - - # driver = "docker" - - # config { - # image = "dxflrs/amd64_garage:v0.7.99-k2v" - # command = "/garage" - # args = [ "offline-repair", "--yes", "object_counters" ] - # network_mode = "host" - # volumes = [ - # "/mnt/storage/garage-staging/data:/data", - # "/mnt/ssd/garage-staging/meta:/meta", - # "secrets/garage.toml:/etc/garage.toml", - # ] - # } - - # template { - # data = file("../config/garage.toml") - # destination = "secrets/garage.toml" - # } - - # resources { - # memory = 2000 - # cpu = 1000 - # } - # } - - task "server" { - driver = "docker" - - config { - image = "dxflrs/amd64_garage:v0.7.99.2-k2v" - command = "/garage" - args = [ "server" ] - network_mode = "host" - volumes = [ - "/mnt/storage/garage-staging/data:/data", - "/mnt/ssd/garage-staging/meta:/meta", - "secrets/garage.toml:/etc/garage.toml", - ] - } - - template { - data = file("../config/garage.toml") - destination = "secrets/garage.toml" - } - - resources { - memory = 1000 - cpu = 1000 - } - - kill_signal = "SIGINT" - kill_timeout = "20s" - - service { - tags = [ - "garage-staging-api", - "tricot garage-staging.home.adnab.me", - "tricot garage.staging.deuxfleurs.org", - "tricot-add-header Access-Control-Allow-Origin *", - ] - port = 3990 - address_mode = "driver" - name = "garage-staging-api" - check { - type = "tcp" - port = 3990 - address_mode = "driver" - interval = "60s" - timeout = "5s" - check_restart { - limit = 3 - grace = "90s" - ignore_warnings = false - } - } - } - - service { - tags = [ - "garage-staging-k2v-api", - "tricot k2v.staging.deuxfleurs.org", - "tricot-add-header Access-Control-Allow-Origin *", - ] - port = 3993 - address_mode = "driver" - name = "garage-staging-k2v-api" - check { - type = "tcp" - port = 3993 - address_mode = "driver" - interval = "60s" - timeout = "5s" - check_restart { - limit = 3 - grace = "90s" - ignore_warnings = false - } - } - } - - service { - tags = ["garage-staging-rpc"] - port = 3991 - address_mode = "driver" - name = "garage-staging-rpc" - check { - type = "tcp" - port = 3991 - address_mode = "driver" - interval = "60s" - timeout = "5s" - check_restart { - limit = 3 - grace = "90s" - ignore_warnings = false - } - } - } - - service { - tags = [ - "garage-staging-web", - "tricot *.web.staging.deuxfleurs.org", - "tricot staging.deuxfleurs.org", - "tricot matrix.home.adnab.me/.well-known/matrix/server", - "tricot-add-header Access-Control-Allow-Origin *", - ] - 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 - } - } - } - - service { - tags = [ - "garage-staging-admin", - ] - port = 3909 - address_mode = "driver" - name = "garage-staging-admin" - } - - restart { - interval = "30m" - attempts = 10 - delay = "15s" - mode = "delay" - } - } - } -} diff --git a/app/garage-staging/secrets/garage-staging/rpc_secret b/app/garage-staging/secrets/garage-staging/rpc_secret deleted file mode 100644 index d831d53..0000000 --- a/app/garage-staging/secrets/garage-staging/rpc_secret +++ /dev/null @@ -1 +0,0 @@ -CMD_ONCE openssl rand -hex 32 |