Skip to content
/ MCing Public

MCing is a Kubernetes operator for Minecraft server.

License

Notifications You must be signed in to change notification settings

kmdkuk/MCing

Repository files navigation

CI

MCing

MCing is a Kubernetes operator for Minecraft server.

Supported software

Quick start

You can quickly run MCing using kind.

$ cd e2e
$ make start bootstrap
$ cat <<EOF > minecraft-sample.yaml
apiVersion: mcing.kmdkuk.com/v1alpha1
kind: Minecraft
metadata:
  name: minecraft-sample
spec:
  # whitelist:
  #   enabled: true
  #   users:
  #     - <invite player name>
  # ops:
  #   users:
  #     - <operator player name>
  podTemplate:
    spec:
      containers:
      - name: minecraft
        image: itzg/minecraft-server:java17
        env:
        - name: TYPE
          value: "PAPER"
        - name: EULA
          value: "true"
  serviceTemplate:
    spec:
      type: NodePort
  volumeClaimTemplates:
  - metadata:
      name: minecraft-data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: standard
      resources:
        requests:
          storage: 1Gi
  serverPropertiesConfigMapName: mcing-server-props
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: mcing-server-props
data:
  motd: "[this is test]A Vanilla Minecraft Server powered by MCing"
  pvp: "true"
  difficulty: "hard"
EOF
$ ../bin/kubectl --kubeconfig .kubeconfig apply -f minecraft-sample.yaml
$ ../bin/kubectl --kubeconfig .kubeconfig port-forward svc/mcing-minecraft-sample 25565:25565

if you can use aqua, it can be developed as follows

$ cd MCing
$ aqua i
$ make start
$ tilt up
Tilt started on http://localhost:10350/
v0.30.4, built 2022-06-16

(space) to open the browser
(s) to stream logs (--stream=true)
(t) to open legacy terminal mode (--legacy=true)
(ctrl-c) to exit

You can access localhost:10350 to check build and controller logs.

For termination, the following

# Exit the tilt up command by typing ctrl-c
$ tilt down
$ make stop

Documentation

See https://kmdk.uk/MCing

Docker images

Docker images are available on ghcr.io/kmdkuk/mcing.