Skip to content
Dashboard

Let servers in

View as Markdown

A server belongs to a network by its key. On its first start, the connector in the Minekube plugin makes a key in the plugin folder, and from then on the key is the server’s identity. A server needs no open port, because players reach it through Minekube’s relays.

A network owner adds a server in one of three ways, each with the server’s consent:

Way When How
Your dev server To play your game with friends from your machine mk server --join my-network
An invite A plain VPS, a hosting panel, a cluster without a public token issuer mk network invite my-network, then put the token in a file the server’s connector.json names
A trust rule A Kubernetes cluster or CI with OpenID Connect tokens mk trust add --network my-network --issuer <url> --subject <sub>; each server joins with the token its environment gives it

An owner cannot add a server’s key without the server, because a key alone is public. The code a new server logs while it belongs to no network (mk claim <code> --network my-network) works too.

Terminal window
mk server --join my-network

mk makes an invite for the dev server, points its connector at the registry and relay, and turns on online mode, because anyone can reach the server now. Players join my-network.<domain>. mk server without --join makes it private again.

Terminal window
mk network invite my-network --labels game=parkour

It prints a one-time token, valid for an hour (--hours, up to a week). On the server, write it to a file and name it in plugins/Minekube/connector.json:

{
"directory": { "registry": "https://registry.staging.minekube.net" },
"relays": ["https://relay.staging.minekube.net/"],
"join": { "network": "my-network", "token": "network-invite" }
}

The server shows the invite once. After that its key is in the network, and a restart keeps it there. --labels gives every server the invite lets in these labels, over its own. A network holds at most 100 unused invites.

A server in Kubernetes already has a token from its environment: a projected service account token. A trust rule lets every server whose token matches join without an invite:

Terminal window
mk trust add --network my-network --issuer https://kubernetes.example --subject system:serviceaccount:games: --prefix --audience minekube --labels game=parkour

In connector.json, "join": {"network": "my-network", "token": "/var/run/secrets/minekube/token"} names the token file. The registry checks the token against the issuer’s published keys; no Minekube secret is stored on the server. Connector, relay and registry explains how.

mk instances --network my-network lists the servers, with their labels and whether they are online.

The connector.json reference lists every field of the file.

Was this helpful?