Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ jobs:
with:
go-version: "1.26"

- name: Check Minecraft proxy startup, console and persistence
timeout-minutes: 20
run: python3 test-minecraft-proxy.py

- name: Check module locales
run: |
set -euo pipefail
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ OCI game templates for Gameplane. Each `<name>/` folder holds `module.yaml`,
`template.yaml`, `README.md` and optional `icon.png`, `specs.md`, `samples/`.
`build.sh push` publishes them; `validate.py` preflight-checks them in CI.

Use the [Minecraft Proxy module](minecraft-proxy/) to route Minecraft Java
players to backend servers through Velocity, Waterfall, or BungeeCord.

## Mixed-architecture clusters

Squad, The Isle, Mount & Blade II: Bannerlord, Nuclear Option and ARK: Survival
Expand Down
108 changes: 108 additions & 0 deletions minecraft-proxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Minecraft Proxy

Route Minecraft Java Edition players to one or more backend servers. The
module requires Gameplane 0.4.1 or later.

## Create the proxy

1. Select **Minecraft Proxy** in the New Server wizard. Choose **Velocity**
(the default), **Waterfall**, or **BungeeCord**. PaperMC has ended support
for Waterfall. [Waterfall end-of-life notice](https://papermc.io/software/waterfall/)
2. In **Initial lobby address**, enter a `host:port` reachable from the proxy
pod. The default `lobby:25565` fits a GameServer named `lobby` in the same
namespace. Use the backend's internal Service DNS name across namespaces.
3. Expose the proxy's `game` port (TCP 25565) to players. Keep TCP 25575
private for RCON and restrict the backend game ports to the proxy.

For a local install, run this command from the modules repository root with
the Gameplane CRDs installed and the operator at version 0.4.1 or later.

```sh
kubectl apply -f minecraft-proxy/template.yaml
```

For Kubernetes manifests, start with the [Velocity sample](samples/velocity.yaml),
[Waterfall sample](samples/waterfall.yaml), or [BungeeCord sample](samples/bungeecord.yaml).
Set the namespace and lobby address for your cluster.

## Configure backend forwarding

Keep the proxy in online mode so it authenticates players. Give backends
private addresses and enforce access to their game ports at the network layer.
Gameplane's default ingress policy allows `0.0.0.0/0` to advertised backend
game ports, including on ClusterIP services. Kubernetes combines the allow
rules from all applicable NetworkPolicies. If you use NetworkPolicy for
isolation, change Gameplane's ingress configuration to narrow or remove its
broad rule and check the other effective rules. You can also restrict access
with network or firewall rules that enforce the proxy-only path.
[Kubernetes NetworkPolicy rules](https://kubernetes.io/docs/concepts/services-networking/network-policies/#the-two-sorts-of-pod-isolation), [PaperMC backend security guide](https://docs.papermc.io/velocity/security/)

Verify that the proxy can connect and that direct connections from clients
and other untrusted workloads fail. Then set `online-mode=false` in the
backend's `server.properties`. For a Gameplane Minecraft Java backend, set
**Online mode** to `false`.

- **Velocity** uses modern forwarding. On a current Paper backend, disable
`settings.bungeecord` in `spigot.yml`. In `config/paper-global.yml`, enable
`proxies.velocity.enabled`, set `proxies.velocity.online-mode` to `true`,
and set `proxies.velocity.secret` to the contents of the proxy's
`forwarding.secret`. The image creates that file on Velocity's first
launch and keeps it on the data volume. Use a backend that supports modern
forwarding. [Velocity forwarding guide](https://docs.papermc.io/velocity/player-information-forwarding/#configuring-modern-forwarding)
- **Waterfall and BungeeCord** use `ip_forward: true` in the proxy's
`config.yml`. On Paper or Spigot, set `settings.bungeecord: true` in
`spigot.yml` and disable Velocity forwarding if enabled. Legacy forwarding
trusts the proxy connection, so the backend network restriction is
essential. [Legacy forwarding guide](https://docs.papermc.io/velocity/player-information-forwarding/#configuring-legacy-bungeecord-compatible-forwarding)

Restart each backend after updating its settings. Keep the forwarding secret
private and update every Velocity backend when you rotate it.

## Edit routing and plugins

Use **Files** to edit `velocity.toml` or `config.yml` in the data root, then
restart the proxy. In Velocity, declare your backends and fallback order in
`[servers]` and map hostnames in `[forced-hosts]`. In Waterfall and BungeeCord,
declare your backends in `servers` and set `priorities` and `forced_hosts` on
the listener. Keep the listener on TCP 25565 so the Gameplane service and
health probes reach it.

**Initial lobby address** only takes effect when the active routing file is
missing. Gameplane refreshes the seed files under `gameplane-defaults/` on pod
startup. Use the live file for routing changes. Waterfall and BungeeCord share
`config.yml`, while Velocity uses `velocity.toml`.

In **Mods**, upload a proxy-compatible `.jar` or install one from an allowed
release URL, then restart. The active proxy type gets its own plugin volume,
including plugin settings. Gameplane retains each volume when you change types.
Back up the plugin volumes separately from the primary GameServer backup,
which covers the routing files and Velocity forwarding secret.

Waterfall uses the archived `1.21` build `615`. On startup the launcher
downloads its six default core modules from PaperMC as needed and verifies
their checksums. If startup reports a checksum mismatch in an installed core
JAR, remove that JAR and restart to fetch a fresh copy. Waterfall and
BungeeCord keep separate core modules in their plugin volumes. When importing
existing proxy data, move `modules/` and `modules.yml` out of the data root
before starting the Gameplane proxy so it can initialize these paths for the
selected type. [PaperMC build metadata](https://fill.papermc.io/v3/projects/waterfall/versions/1.21/builds/615)

## Console and updates

Use **Console** to run commands supported by the selected proxy. Use the
backend GameServers for player statistics and idle detection.

Gameplane generates the RCON password under the `password` key in the
Kubernetes Secret `<name>-rcon` and uses RCON for Console and graceful
shutdown. The image writes the password to `plugins/velocircon/rcon.yml`
for Velocity or `plugins/bungee-rcon/config.yml` for Waterfall and BungeeCord.
It writes these files only when absent. After rotation or a restore, make
sure the Secret and the active plugin configuration use the same password,
then restart. Repeat for each retained plugin volume before switching back
to its proxy type. Treat these plugin files and backups as credentials.

The image digest pins the launcher and Java 25 runtime. The launcher resolves
and downloads the selected proxy and RCON plugin from upstream. Velocity and
BungeeCord build selection can change independently of the image digest.
Check upstream availability and client, backend, and plugin compatibility
before switching types. [itzg/mc-proxy documentation](https://github.com/itzg/docker-mc-proxy/tree/2026.11.1)
11 changes: 11 additions & 0 deletions minecraft-proxy/module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: minecraft-proxy
displayName: Minecraft Proxy
version: 1.0.0
game: minecraft-proxy
categories: [Sandbox, Modded]
summary: Velocity, Waterfall, and BungeeCord proxies for Minecraft Java networks, with persistent routing and per-proxy plugins.
homepage: https://github.com/itzg/docker-mc-proxy
license: MIT
gameplaneMinVersion: 0.4.1
12 changes: 12 additions & 0 deletions minecraft-proxy/samples/bungeecord.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: gameplane.local/v1alpha1
kind: GameServer
metadata:
name: bungeecord-01
namespace: gameplane-games
spec:
templateRef:
name: minecraft-proxy
version: bungeecord
config:
# Replace with the private address of your first backend.
INITIAL_BACKEND: "lobby:25565"
12 changes: 12 additions & 0 deletions minecraft-proxy/samples/velocity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: gameplane.local/v1alpha1
kind: GameServer
metadata:
name: velocity-01
namespace: gameplane-games
spec:
templateRef:
name: minecraft-proxy
version: velocity
config:
# Replace with the private address of your first backend.
INITIAL_BACKEND: "lobby:25565"
12 changes: 12 additions & 0 deletions minecraft-proxy/samples/waterfall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: gameplane.local/v1alpha1
kind: GameServer
metadata:
name: waterfall-01
namespace: gameplane-games
spec:
templateRef:
name: minecraft-proxy
version: waterfall
config:
# Replace with the private address of your first backend.
INITIAL_BACKEND: "lobby:25565"
75 changes: 75 additions & 0 deletions minecraft-proxy/specs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Minecraft Proxy module specification

## Template and runtime

| Setting | Value |
| --- | --- |
| Module, template and game ID | `minecraft-proxy` |
| Module and template version | `1.0.0` |
| Minimum Gameplane version | `0.4.1` |
| Image | `itzg/mc-proxy:2026.11.1-java25@sha256:8efdaa9d990f4c509f21b7ced003dd959060777784422fd72fdd537d613c1813` |
| Linux architectures | `amd64`, `arm64` |
| User, group and filesystem group | `1000` |
| Working directory and `HOME` | `/server` |
| Primary volume | `1Gi` at `/server` |
| CPU request and limit | `100m` and `1` |
| Memory request and limit | `256Mi` and `1Gi` |

| `spec.version` | Image `TYPE` | Loader | Active routing file |
| --- | --- | --- | --- |
| `velocity` (default) | `VELOCITY` | `velocity` | `/server/velocity.toml` |
| `waterfall` | `WATERFALL` | `waterfall` | `/server/config.yml` |
| `bungeecord` | `BUNGEECORD` | `bungeecord` | `/server/config.yml` |

The fallback image environment selects `VELOCITY`. Each loader mounts its own
plugin PVC at `/server/plugins` and accepts `.jar` uploads and allowlisted
URL installs. Switching types retains the other PVCs. The primary GameServer
backup covers the data PVC. Back up each plugin PVC separately.

## Startup, routing and persistence

The operator renders `gameplane-defaults/config.yml` and
`gameplane-defaults/velocity.toml` on the data PVC every pod start. Both use
`INITIAL_BACKEND` (default `lobby:25565`) for the seed route named `lobby`.
The wrapper copies the active seed when its routing file is absent, then
hands off to `/usr/bin/run-bungeecord.sh`. It sets `umask 0007` to allow
shared group access and restrict permissions for other users.

The two live routing files persist independently. Waterfall and BungeeCord
read the same `config.yml`. Existing live files take precedence over seeds,
including after a change to `INITIAL_BACKEND`. Edit the live routing file to
add backend servers, fallback priorities, or forced hosts.

Both seeds bind TCP `0.0.0.0:25565`, authenticate clients, route to `lobby`,
and disable query. The Bungee-family seed enables legacy IP forwarding with
`ip_forward: true`. The Velocity 2.7 seed enables modern forwarding with
`forwarding.secret`. The upstream launcher creates the secret if it is absent
and reuses it on later starts. Restrict direct access to the offline-mode
backends and configure them for the matching forwarding format.

Waterfall runs archived `1.21` build `615`. Its bundled module downloader
uses the legacy PaperMC API. The wrapper fetches six matching JARs from
PaperMC's content-addressed store and checks them against the operator-rendered
`gameplane-defaults/waterfall-modules.sha256` before starting the proxy.
For Waterfall and BungeeCord, the wrapper creates `modules` and `modules.yml`
links at the data root when absent. These resolve under
`plugins/.gameplane-proxy-modules` in the active type's plugin PVC.
[Waterfall module downloader source](https://github.com/PaperMC/Waterfall/blob/150a002/BungeeCord-Patches/0006-Fetch-modules-from-the-Waterfall-API-endpoint.patch), [PaperMC build metadata](https://fill.papermc.io/v3/projects/waterfall/versions/1.21/builds/615)

## Probes, console and JVM

- The public port is `game` on TCP 25565. Startup, readiness and liveness use
`/usr/bin/health.sh` with `SERVER_PORT=25565`. The startup probe budgets
60 attempts at 10-second intervals for installation and startup.
- The internal `rcon` port is TCP 25575 and uses the Source RCON protocol.
Gameplane injects `RCON_PASSWORD` from its generated Secret and the
upstream launcher enables the appropriate RCON plugin. Lifecycle stop
sends the `end` command.
- `INIT_MEMORY` defaults to `128M`. `MAX_MEMORY` defaults to 75% of the
effective memory limit, computed by Gameplane as a Java heap size in
mebibytes. `JVM_OPTS` and `JVM_XX_OPTS` pass optional JVM arguments. All
four settings apply at restart.

See the [setup guide](README.md) for credential rotation and backend
configuration. The image's [pinned launcher source](https://github.com/itzg/docker-mc-proxy/blob/89a7d3ad7dc6f9e8a93d52224c3899e06f8a89ac/scripts/run-bungeecord.sh)
defines upstream downloads and initialization behavior.
Loading
Loading