Skip to content

rcreasey/kubernetes-minecraft-operator

Repository files navigation

Kubernetes Minecraft Operator

An unoffical Kubernetes operator for dedicated servers of the video game Minecraft Java Edition. This allows you to administer and configure a Minecraft server solely using the Kubernetes API — no remote shell, SFTP, or graphical admin interfaces are required.

ℹ️ This is not an offical Minecraft project. It is not approved by or associated with Mojang.

🚧 This is alpha-grade software. No guarantee is provided (see the license), and users are responsible for the security and data-integrity of their own servers. The API surface is subject to change without notice.

Installing

You can install the latest version of the operator by running this command with your cluster configured in kubectl.

curl -L https://github.com/JamesLaverack/kubernetes-minecraft-operator/releases/latest/download/operator.yaml | kubectl apply -f -

Tags

The command above will install the operator at a specific release. You can also change the image tag to either latest to always get the latest published release or edge to get the latest build of the main branch. However, doing so won't get you YAML updates (e.g., adding new permissions or custom resource definition updates). (Also the edge tag publishes before tests are run, so it comes with even fewer guarantees than normal.)

Verify

You can verify everything is working by looking for the operator Pod in the kubernetes-minecraft-operator-system namespace, e.g.:

kubectl --namespace kubernetes-minecraft-operator-system get pod

If this gives you a running Pod, then it's likely all good.

Usage

Once the operator is installed, you can create a Minecraft server by creating a MinecraftServer object in Kubernetes. This will create and manage resources such as a Pod and a Service. Resources are created in whatever namespace the MinecraftServer object is in.

Note that the API uses "allowList" in place of "whitelist", but it is applied to the server in the same way.

Example Server

apiVersion: minecraft.jameslaverack.com/v1alpha1kind: MinecraftServermetadata: name: my-minecraft-serverspec: eula: AcceptedminecraftVersion: 1.18.1type: PaperopsList: - name: Player1uuid: da6a1ae6-e2f5-4e32-9135-b82a9ef426a9allowList: - name: Player2uuid: 880182d6-a0e3-44cd-a57c-8dc3799e92b8world: persistentVolumeClaim: claimName: minecraft-worldmotd: "My Minecraft Server"maxPlayers: 8viewDistance: 16externalServiceIP: 192.168.1.51vanillaTweaks: survival: - 'multiplayer sleep' - 'afk display'items: - 'player head drops' --- apiVersion: v1kind: PersistentVolumeClaimmetadata: name: minecraft-worldspec: accessModes: - ReadWriteOnceresources: requests: storage: 10Gi

About

A Kubernetes operator for Minecraft Java Edition servers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go98.5%
  • Dockerfile1.5%