Very easy setup of minecraft servers managed in a lightweight Kubernetes cluster.
Thanks to https://github.com/gilesknap/k3s-minecraft as a project reference.
There is an installer script that installs everything for convenience.
The script is setup.sh. You probably need to chmod 755 it.
Docker is needed, obviously.
K3s is a lightweight kubernetes distribution, easy to install and great for homelab.
Kubectl is the CLI for kubernetes, allowing us to communicate with the cluster.
Helm helps to manage Kubernetes apps, here through re-using an existing minecraft server chart.
Contains the helm chart baseline.
Create a new yaml file based on kubernetes/external/minecraft/minecraft-helm-base.yaml. Provide it with the values you need.
Use:
helm upgrade --install [SERVER_NAME] -f [SERVER_NAME_PATH] --set minecraftServer.eula=true,rcon.password=[RCON_PASSWORD] minecraft-server-charts/minecraft
helm delete [SERVER_NAME]
A collection of prometheus & grafana in order to easily visualize data like ressource usage or uptime.
Go to kubernetes/external/kube-prometheus-stack and use ./setup.sh.
- Prometheus
- Grafana
- PV & PVC for consistent data
- Service to expose grafana URL
We use traefik, that is provided by k3s, to manage networking.
Traefik is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease. It simplifies networking complexity while designing, deploying, and running applications.
By default, K3s provides a load balancer known as ServiceLB (formerly Klipper LoadBalancer) that uses available host ports.
The ServiceLB controller watches Kubernetes Services with the spec.type field set to LoadBalancer.
In this repo services are often added under kubernetes/internal/traefik/service.yaml and then we define the ingress
under its respective directory.