From b1dbed2e9126d327c255bc35493b092ddb86d8fb Mon Sep 17 00:00:00 2001 From: James Hackett Date: Thu, 4 Jan 2024 16:48:49 +0000 Subject: [PATCH] Add vanilla server and update router --- jobs/mc-router.hcl | 4 ++- jobs/minecraft.hcl | 85 ++++++++++++++++++++-------------------------- 2 files changed, 39 insertions(+), 50 deletions(-) diff --git a/jobs/mc-router.hcl b/jobs/mc-router.hcl index 217a47d..2b16e33 100644 --- a/jobs/mc-router.hcl +++ b/jobs/mc-router.hcl @@ -52,7 +52,9 @@ config: routes: - host: fugitives.rb.dcu.ie - backend: fugitives-mc.service.consul:25566 + backend: fugitives-mc.service.consul:25566 + - host: mc.rb.dcu.ie + backend: vanilla-mc.service.consul:25567 EOH destination = "local/file.conf" } diff --git a/jobs/minecraft.hcl b/jobs/minecraft.hcl index 8b2b277..9531e5c 100644 --- a/jobs/minecraft.hcl +++ b/jobs/minecraft.hcl @@ -2,49 +2,41 @@ job "minecraft" { datacenters = ["aperture"] type = "service" -# group "vanilla" { -# constraint { -# attribute = "${attr.unique.hostname}" -# value = "glados" -# } -# -# count = 1 -# network { -# port "mc-vanilla-port" { -# static = 25565 -# to = 25565 -# } -# port "mc-vanilla-rcon" { -# to = 25575 -# } -# #mode = "bridge" -# } -# -# service { -# name = "minecraft-vanilla" -# } -# -# task "minecraft-server" { -# driver = "docker" -# config { -# image = "itzg/minecraft-server" -# ports = ["mc-vanilla-port","mc-vanilla-rcon"] -# volumes = [ -# "/storage/nomad/${NOMAD_TASK_NAME}:/data/world" -# ] -# } -# -# resources { -# cpu = 3000 # 500 MHz -# memory = 6144 # 6gb -# } -# -# env { -# EULA = "TRUE" -# MEMORY = "6G" -# } -# } -# } + group "vanilla-mc" { + count = 1 + + network { + port "mc-vanilla-port" { + static = 25567 + to = 25565 + } + port "mc-vanilla-rcon" { + to = 25575 + } + } + + service { + name = "vanilla-mc" + } + + task "minecraft-server" { + driver = "docker" + config { + image = "itzg/minecraft-server" + ports = ["mc-vanilla-port","mc-vanilla-rcon"] + } + + resources { + cpu = 3000 # 3000 MHz + memory = 7168 # 7gb + } + + env { + EULA = "TRUE" + MEMORY = "6G" + } + } + } group "fugitives-mc" { count = 1 @@ -58,8 +50,6 @@ job "minecraft" { port "mc-fugitives-rcon" { to = 25575 } - - #mode = "bridge" } service { @@ -72,13 +62,10 @@ job "minecraft" { config { image = "itzg/minecraft-server" ports = ["mc-fugitives-port","mc-fugitives-rcon"] - #volumes = [ - # "/storage/nomad/${NOMAD_TASK_NAME}:/data/world" - #] } resources { - cpu = 3000 # 500 MHz + cpu = 3000 # 3000 MHz memory = 8168 # 8gb }