Minecraft Status Page


This is a very small app that I developed to let my kids have an easy way to know the status of our Minecraft servers as well as what our current IP address is. It also makes for an easy way to share this information with their friends. It is a very small PHP application based off the PHP docker container. I utilize some publicly available Minecraft APIs and parse the resulting JSON.

Feel free to view the code or fork it for your own needs from my Github Repository.

The following diagram explains the current flow:
Swimlane Process Diagram

This diagram was made with PlantUML

Below is how I've implemented this simple Minecraft Status Page into my Kubernetes cluster.

Product Name: MC Status Page
Install Type: Manifest Files
Container Image: Docker

Installation Details

I have not as of yet created a Helm chart for this, so I have configured traditional manifest files for these. For Kubernetes you will need to provide a Config Map, a Deployment, a Service, and an Ingress.

The following assume you have an existing namespace named minecraft. Please adjust for your particular needs

01-mcstatus-configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: mcstatus-mcserver
  namespace: minecraft
data:
  MINECRAFT_SERVER1: your.bedrock.server.hostname
  MINECRAFT_SERVER2: your.other.bedrock.server.hostname
  JAVA_MINECRAFT_SERVER1: your.java.server.hostname
  JAVA_MINECRAFT_SERVER2: your.other.java.server.hostname

You can define as many as 9 different Bedrock and Java servers using this method. If you do not have a a particular type of server, just do no define the variable for that type (e.g. omit any MINECRAFT_SERVER lines to not show any Bedrock servers). You will also need to provide the externally accessible FQDN to your Minecraft server for the API to work.

02-mcstatus-deploy.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mcstatus
  namespace: minecraft
  labels:
    app: mcstatus
    layer: frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mcstatus
  template:
    metadata:
      labels:
        app: mcstatus
    spec:
      containers:
        - name: mcstatus
          image: asokolik/mcstatus:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 80
         envFrom:
            - configMapRef:
                name: mcstatus-mcserver

03-mcstatus-service.yaml

kind: Service
apiVersion: v1
metadata:
  name: mcstatus
  namespace: minecraft
  labels:
    app: mcstatus
    layer: frontend
spec:
  type: ClusterIP
  selector:
    app: mcstatus
  ports:
    - Protocol: TCP
      port: 80
      targetPort: 80

04-mcstatus-ingress.yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: mcstatus
  namespace: minecraft
  annotations:
    cert-manager.io/cluster-issuer: 'letsencrypt'
spec:
  ingressClassName: nginx
  rules:
    - host: your.host.name
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: mcstatus
              port:
                number: 80
  tls:
    - hosts:
      - your.host.name
      secretName: mcstatus-ext-tls

This ingress definition assumes that there is already an installed and configured Ingress (that relies on MetalLB for LoadBalancer) and Cert Manager to provide certificated with ACME provider Let's Encrypt. You may need to adjust this for your needs.

These files can then be applied to your cluster with kubectl:

kubectl apply -f 01-mcstatus-configmap.yaml \
              -f 02-mcstatus-deploy.yaml \
              -f 03-mcstatus-service.yaml \
              -f 04-mcstatus-ingress.yaml