diff --git a/jobs/ingress/gate-proxy.hcl b/jobs/ingress/gate-proxy.hcl index 8039cbb..be16374 100644 --- a/jobs/ingress/gate-proxy.hcl +++ b/jobs/ingress/gate-proxy.hcl @@ -8,7 +8,7 @@ job "gate-proxy" { network { port "mc" { - static = 4501 + static = 25565 } } @@ -30,7 +30,7 @@ job "gate-proxy" { ports = ["mc"] volumes = [ - "local/file.conf:/config.yaml" + "local/config.yaml:/config.yaml" ] } @@ -40,7 +40,7 @@ job "gate-proxy" { # settings are omitted and will be set by default. # See config.yml for the full configuration options. config: - bind: 0.0.0.0:4501 + bind: 0.0.0.0:{{ env "NOMAD_PORT_mc" }} forwarding: mode: legacy @@ -48,24 +48,18 @@ config: lite: enabled: true routes: - - host: regaus.rb.dcu.ie - backend: regaus-mc.service.consul:25566 - - host: mc.rb.dcu.ie - backend: vanilla-mc.service.consul:25567 - - host: olim909.rb.dcu.ie - backend: olim909-mc.service.consul:25568 - - host: olim909-geyser.rb.dcu.ie - backend: olim909-mc.service.consul:19132 - - host: games.rb.dcu.ie - backend: games-mc.service.consul:25569 - - host: fugitives.rb.dcu.ie - backend: fugitives-mc.service.consul:25570 - - host: cjaran-mc.rb.dcu.ie - backend: cjaran-mc.service.consul:25571 - - host: magma-mc.rb.dcu.ie - backend: minecraft-magma.service.consul:25572 + # Consul template to generate routes + # matches against all consul services ending in "-mc" + # NOTE: each minecraft job must have both: + # - a name ending in "-mc" + # - a port attached to the service + {{- range services }} + {{- if .Name | regexMatch ".*-mc$" }} + {{- range service .Name }} + - host: {{ .Name }}.rb.dcu.ie + backend: {{ .Name }}.service.consul:{{ .Port }}{{ end -}}{{ end -}}{{ end -}} EOH - destination = "local/file.conf" + destination = "local/config.yaml" } } }