diff --git a/games/games-service.yaml b/games/games-service.yaml index 4a7b686..5678408 100644 --- a/games/games-service.yaml +++ b/games/games-service.yaml @@ -15,4 +15,7 @@ spec: protocol: TCP port: 27015 targetPort: 27015 + - name: minecraft + port: 25565 + targetPort: 25565 type: LoadBalancer diff --git a/games/minecraft/minecraft-data-pvc.yaml b/games/minecraft/minecraft-data-pvc.yaml new file mode 100644 index 0000000..1f53067 --- /dev/null +++ b/games/minecraft/minecraft-data-pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: factorio-pvc + namespace: games-ns +spec: + accessModes: + - ReadWriteMany + storageClassName: longhorn + resources: + requests: + storage: 16Gi diff --git a/games/minecraft/minecraft-deployment.yaml b/games/minecraft/minecraft-deployment.yaml new file mode 100644 index 0000000..f529558 --- /dev/null +++ b/games/minecraft/minecraft-deployment.yaml @@ -0,0 +1,40 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minecraft + namespace: games-ns +spec: + replicas: 1 + selector: + matchLabels: + app: games + template: + metadata: + labels: + app: games + spec: + containers: + - name: minecraft + image: itzg/minecraft-server + #env: + ports: + - containerPort: 25565 + readinessProbe: + exec: + command: [ "/usr/local/bin/mc-monitor", "status", "--host", "localhost" ] + # Give it i + p * f seconds to be ready, so 120 seconds + initialDelaySeconds: 20 + periodSeconds: 5 + failureThreshold: 20 + livenessProbe: + exec: + command: ["/usr/local/bin/mc-monitor", "status", "--host", "localhost"] + initialDelaySeconds: 120 + periodSeconds: 60 + volumeMounts: + - name: minecraft-data + mountPath: /data + volumes: + - name: minecraft-data + persistentVolumeClaim: + claimName: minecraft-data-pvc