Skip to content
Merged
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
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
[![Discord](https://img.shields.io/discord/660567679458869252?label=discord)](https://discord.gg/JK2v3rJ9ec)
[![Buy me a coffee](https://img.shields.io/badge/Donate-Buy%20me%20a%20coffee-orange.svg)](https://www.buymeacoffee.com/itzg)

Routes Minecraft client connections to backend servers based upon the requested server address.
Routes Minecraft Java Edition client connections to backend servers based upon the requested server address. This is quite helpful for home network deployments where any number of Minecraft servers can be multiplexed onto a single, public IP address and standard Minecraft port. It works great with [itzg/minecraft-server](https://github.com/itzg/docker-minecraft-server), but can be used with any Minecraft server. Stand-alone binaries are also published for Linux, Mac, and Windows if not wanting to use containers at all.

Some other features included:

- Dynamic auto-discovery of backend servers in Kubernetes and Docker which allows for "zero-config" mapping of your Minecraft server hostnames to backend servers protected behind mc-router.
- Minimizes unwanted intrusions by disallowing Minecraft port scanners that are not specifying a mapped server hostname.
- Rate limits incoming connections to reduce DDoS attacks.
- Can be configured to allow/deny IP addresses or ranges
- Includes a webhook integration for notifying other systems when a player connects and disconnects from a server.
- Can auto-scale (between zero and one) backend servers deployed as Kubernetes StatefulSets.
- Built-in ngrok integration where mc-router acts as an agent
- Exports/exposes metrics for various Prometheus and InfluxDB. If enabled, includes player login metrics.

## Usage

Expand Down Expand Up @@ -382,6 +393,19 @@ metadata:
"mc-router.itzg.me/autoScaleDown": "false"
```

### Troubleshooting

First and foremost, enable debug logs on mc-router by setting the `DEBUG` environment variable to "true". With that, the logs will be fairly verbose with information about incoming connections, handshake processing, backend service discovery, and backend connection establishment and teardown.

If backend service discovery doesn't seem to be happening, then double-check the service annotations, [described above](#using-kubernetes-service-auto-discovery), are applied to the backend `Service` objects and that those are selecting a Minecraft service deployment each.

If the client reports "Connection refused" check:

- `Service` type is configured as `NodePort` (or `LoadBalancer` if applicable)
- Use `kubectl describe service mc-router` for the next few steps
- If running on a home network, ensure the public internet router is port forwarding TCP 25565 to one of the kubernetes nodes and the reported `NodePort` value, usually in the 30000-32767 range.
- Ensure the `Endpoints` field contains at least one entry referencing the cluster IP address of the mc-router `Pod`. If not, check that the `Selector` matches the labels on the mc-router `Pod`.

## REST API

* `GET /routes` (with `Accept: application/json`)
Expand Down
Loading