Skip to content

Introduction

mc-operator is a production-grade Kubernetes Operator for managing Minecraft server deployments. It is built with .NET 10 and KubeOps 10, and is maintained under the dhv.sh umbrella.

Running a Minecraft server on Kubernetes without an operator means manually writing and maintaining StatefulSets, Services, PersistentVolumeClaims, ConfigMaps, and webhook configs — then keeping them all consistent across environments. This is error-prone and tedious.

mc-operator turns server administration into a single Kubernetes resource:

apiVersion: mc-operator.dhv.sh/v1alpha1
kind: MinecraftServer
metadata:
name: paper-survival
namespace: minecraft
spec:
acceptEula: true
server:
type: Paper
version: "1.20.4"
jvm:
initialMemory: "2G"
maxMemory: "4G"
storage:
size: "20Gi"

The operator takes care of the rest: provisioning storage, configuring the server, exposing it on the network, and continuously reconciling the desired state.

TypeDescription
VanillaOfficial Mojang server jar
PaperHigh-performance Paper fork — recommended for production
SpigotSpigot with Bukkit API support
BukkitCraftBukkit server

All distributions are backed by the community-standard itzg/minecraft-server Docker image, which handles version management and configuration via environment variables.

  • CRD-driven: MinecraftServer is a first-class Kubernetes resource with a typed spec and status.
  • Cluster management: MinecraftServerCluster manages multiple backend servers behind a Velocity proxy with automatic server registration and forwarding secret management.
  • Admission webhooks: A validating webhook rejects invalid configurations before they reach the cluster. A mutating webhook applies sensible defaults.
  • Safe data handling: PVCs are retained by default when a server is deleted, preventing accidental data loss.
  • Zero-downtime version upgrades: When spec.prePull: true is set and a server version is changed, the operator pre-pulls the new container image and pre-downloads the Minecraft server jar to the data volume while the server is still running. The rolling update then only waits for the server process to start — not for any downloads.
  • Pause/resume: Set spec.replicas: 0 to pause a server and retain all world data. Set back to 1 to resume.
  • Status reporting: The operator continuously reports the server’s phase (Pending, Provisioning, Running, Paused, Failed), connection endpoint, and PVC status.
  • Leader election: Deploy multiple operator replicas safely using built-in leader election.
  • Helm chart: Clean, versioned Helm chart published to GHCR as an OCI artifact.

mc-operator is a lifecycle manager — it manages server infrastructure, not game content. It does not:

  • Install or manage plugins
  • Handle automated world backups
  • Provide RCON command routing

These are intentional scope decisions. See the Roadmap for future plans.