Minecraft


Adguard HomeMinecraft is ubiquitous these days and still popular with my older kids. With the ability to run dedicated servers in Linux, there have been projects to containerize this popular game. This is one of the first services I migrated from a dedicated server to a container running in a Kubernetes Cluster. I run the Java Edition server and use plugins to provide Bedrock support. Below is how I've implemented Minecraft into my Kubernetes cluster.

Product: Minecraft
Install Type: Helm (Chart)
Container Image: Docker

Installation Details

First, as with all my Helm deployments I always start with by adding the Helm Repo:

helm repo add minecraft-server-charts https://itzg.github.io/minecraft-server-charts/
helm repo update

After that, I'll grab the Values from the Chart to modify with:

helm show values minecraft-server-charts/minecraft > values.yaml

Adding Bedrock support with Geyser

I use Paper as an API plugin to help expand Minecraft this allows me to deploy plugins like Geyser, ViaVersion, and Floodgate easily. This is very easy to do if using the Helm chart listed above. We simply need to modify the following lines to install Paper and my other plugins:

minecraftServer:
  ...
  paperDownloadUrl: https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/450/downloads/paper-1.20.4-450.jar
  ...
  pluginUrls: 
    - https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/4.9.2/PAPER/ViaVersion-4.9.2.jar
    - https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
    - https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot

Please check the Paper download website for the latest version and the download link to put into your paperDownloadUrl line

This will automatically install Paper in the Minecraft deployment and then automatically download the appropriate plugin at start.

Finally, let's deploy this in our cluster with the custom values to the cluster into a namespace named minecraft:

helm upgrade --install -n minecraft --create-namespace \
         -f values.yaml minecraft minecraft-server-charts/minecraft

Pro Tip

Place this command into a Bash script for easy reuse. Also, consider storing your yaml files into a code repository such as git for version control