Minecraft Bedrock on Kubernetes
A while ago I setup a Minecraft server for myself and my kids to play together on. We don't play that often so I often seem to run into an issue of the server running an older version of the client. Updating minecraft manually typically takes me fifteen to twenty minutes and by the time I get it done the kids are on to something else.
So I have been wanting to either make or find an automated way to update the Minecraft server and I have been working with Kubernetes quite a bit lately so I wondered if there was a way to get it working on Kubernetes.
Helm is a package manager for Kubernetes but unfortunately I could only find a Helm chart for Minecraft Java edition which you can check out here.
I did happen to find a docker container for bedrock from here and he even has a few example configs:
There are only three resources you need to setup to get Minecraft Bedrock up and running in Kubernetes.
A Persistent Volume Claim so that you can save your data:
The next item is a Deployment to handle the creation of the pod/container instance:
The container supports a number of configuration settings that you can find here.
The last item you need is a Service to expose the UDP port. Since Minecraft bedrock uses UDP protocol we do need a load balancer in our config. As far as I know it inst possible to use an HTTP endpoint.
You can upload the configs with the typical kubectl apply
kubectl apply -f bedrock-pvc.yaml
kubectl apply -f bedrock-deployment.yaml
kubectl apply -f bedrock-service.yaml
One thing to keep in mind with this setup is the server is completely open so you will either want to configure access at a firewall or shell into the docker container and configure a whitelist of users that can login.
I haven't been able to test updating yet but hopefully its as simple as killing the pod and letting the deployment bring up the new instance.🤞