garage prod: use dynamically determined ipv6 addresses

This commit is contained in:
Alex 2023-12-13 17:33:56 +01:00
parent d694ddbe2c
commit 47e982b29d
2 changed files with 13 additions and 4 deletions
cluster/prod/app/garage

View file

@ -6,8 +6,17 @@ db_engine = "lmdb"
replication_mode = "3" replication_mode = "3"
rpc_bind_addr = "[{{ env "meta.public_ipv6" }}]:3901" # IPv6 config using the ipv6 address statically defined in Nomad's node metadata
rpc_public_addr = "[{{ env "meta.public_ipv6" }}]:3901" # make sure to put back double { and } if re-enabling this
#rpc_bind_addr = "[{ env "meta.public_ipv6" }]:3901"
#rpc_public_addr = "[{ env "meta.public_ipv6" }]:3901"
# IPv6 config using the ipv6 address dynamically detected from diplonat
{{ 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 }}" rpc_secret = "{{ key "secrets/garage/rpc_secret" | trimSpace }}"
[consul_discovery] [consul_discovery]

View file

@ -4,7 +4,7 @@ job "garage" {
priority = 80 priority = 80
update { update {
max_parallel = 10 max_parallel = 2
min_healthy_time = "60s" min_healthy_time = "60s"
} }
@ -26,7 +26,7 @@ job "garage" {
task "server" { task "server" {
driver = "docker" driver = "docker"
config { config {
image = "dxflrs/garage:v0.9.0-rc2" image = "dxflrs/garage:v0.9.0"
command = "/garage" command = "/garage"
args = [ "server" ] args = [ "server" ]
network_mode = "host" network_mode = "host"