diff --git a/apps/minecraft/README.md b/apps/minecraft/README.md new file mode 100644 index 0000000..52ec321 --- /dev/null +++ b/apps/minecraft/README.md @@ -0,0 +1,7 @@ +## Sending a command +``` +kubectl exec -it -n minecraft deploy/minecraft-server -- /bin/bash +mc-send-to-console /help +# or directly +kubectl exec -it -n minecraft deploy/minecraft-server -- mc-send-to-console /help +``` diff --git a/apps/minecraft/deployment.yaml b/apps/minecraft/deployment.yaml new file mode 100644 index 0000000..ff69148 --- /dev/null +++ b/apps/minecraft/deployment.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minecraft-server +spec: + selector: + matchLabels: + app: minecraft-server + template: + metadata: + labels: + app: minecraft-server + spec: + containers: + - name: minecraft-server + image: minecraft + resources: + limits: + memory: "4000Mi" + cpu: "2500m" + requests: + memory: "1000Mi" + cpu: "500m" + ports: + - containerPort: 25565 + env: + - name: EULA + value: "TRUE" + - name: MODPACK + value: "https://www.curseforge.com/api/v1/mods/711537/files/5076228/download" + - name: VERSION + value: "1.18.2" + # - name: VERSION + # value: "1.16.5" + # - name: MODPACK + # value: "https://mediafilez.forgecdn.net/files/3602/5/VaultHunters-OfficialModpack-1.12.1-Server.zip" + - name: INIT_MEMORY + value: "1G" + - name: MAX_MEMORY + value: "3G" + - name: MOTD + value: "VaultHunters baby!" + - name: ENABLE_RCON + value: "false" + - name: CREATE_CONSOLE_IN_PIPE + value: "true" + - name: ONLINE_MODE + value: "true" + volumeMounts: + - name: minecraft-data + mountPath: /data + + volumes: + - name: minecraft-data + persistentVolumeClaim: + claimName: minecraft-data diff --git a/apps/minecraft/kustomization.yaml b/apps/minecraft/kustomization.yaml new file mode 100644 index 0000000..124e1d0 --- /dev/null +++ b/apps/minecraft/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: minecraft + +resources: + - namespace.yaml + - pvc.yaml + - deployment.yaml + - service.yaml + +images: + - name: minecraft + newName: itzg/minecraft-server + newTag: java21 diff --git a/apps/minecraft/namespace.yaml b/apps/minecraft/namespace.yaml new file mode 100644 index 0000000..0a074bd --- /dev/null +++ b/apps/minecraft/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: placeholder diff --git a/apps/minecraft/pvc.yaml b/apps/minecraft/pvc.yaml new file mode 100644 index 0000000..c30def1 --- /dev/null +++ b/apps/minecraft/pvc.yaml @@ -0,0 +1,11 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: minecraft-data +spec: + storageClassName: "nfs-client" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/apps/minecraft/service.yaml b/apps/minecraft/service.yaml new file mode 100644 index 0000000..bf230d6 --- /dev/null +++ b/apps/minecraft/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: minecraft-server +spec: + selector: + app: minecraft-server + ports: + - port: 25565 + targetPort: 25565 + type: LoadBalancer + loadBalancerIP: 192.168.3.4