From 630e3c00747068062bf2dde85bc9247234d5edb1 Mon Sep 17 00:00:00 2001 From: Justin Barlow <7@netlobo.com> Date: Sun, 11 May 2025 09:12:21 -0600 Subject: [PATCH] Added Nomad example with routes config (#413) --- docs/nomad-example.nomad.hcl | 91 ++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 docs/nomad-example.nomad.hcl diff --git a/docs/nomad-example.nomad.hcl b/docs/nomad-example.nomad.hcl new file mode 100644 index 0000000..edce55e --- /dev/null +++ b/docs/nomad-example.nomad.hcl @@ -0,0 +1,91 @@ +job "mc-router" { + datacenters = ["dc1"] + type = "service" + + update { + max_parallel = 1 + min_healthy_time = "10s" + healthy_deadline = "5m" + progress_deadline = "10m" + auto_revert = false + canary = 0 + } + + migrate { + max_parallel = 1 + health_check = "checks" + min_healthy_time = "10s" + healthy_deadline = "5m" + } + + group "mc-router" { + count = 1 + + network { + port "minecraft" { + static = 25565 + } + } + + service { + name = "mc-router" + tags = ["global", "minecraft", "tcp"] + port = "minecraft" + provider = "consul" + + check { + name = "alive" + type = "tcp" + port = "minecraft" + interval = "10s" + timeout = "2s" + } + } + + restart { + attempts = 2 + interval = "30m" + delay = "15s" + mode = "delay" + } + + task "mc-router" { + driver = "docker" + + config { + image = "itzg/mc-router" + ports = ["minecraft"] + auth_soft_fail = true + } + + resources { + cpu = 2000 # 2000Mhz + memory = 256 # 256MB + } + + template { + data = <