--- apiVersion: apps/v1 kind: Deployment metadata: name: minecraft namespace: minecraft labels: app: minecraft spec: selector: matchLabels: app: minecraft replicas: 1 strategy: type: Recreate template: metadata: labels: app: minecraft spec: nodeSelector: kubernetes.io/hostname: master.tail2fe2d.ts.net volumes: - name: storage hostPath: path: /k8s/mc-server/ type: DirectoryOrCreate - name: nginx-config configMap: name: nginx-config - name: client-scripts configMap: name: client-scripts terminationGracePeriodSeconds: 10 containers: - name: minecraft image: 'openjdk:8-jdk-alpine' command: ["java"] args: - -Xms4G - -Xmx4G - -XX:+UseG1GC - -XX:+ParallelRefProcEnabled - -XX:MaxGCPauseMillis=200 - -XX:+UnlockExperimentalVMOptions - -XX:+DisableExplicitGC - -XX:+AlwaysPreTouch - -XX:G1NewSizePercent=30 - -XX:G1MaxNewSizePercent=40 - -XX:G1HeapRegionSize=8M - -XX:G1ReservePercent=20 - -XX:G1HeapWastePercent=5 - -XX:G1MixedGCCountTarget=4 - -XX:InitiatingHeapOccupancyPercent=15 - -XX:G1MixedGCLiveThresholdPercent=90 - -XX:G1RSetUpdatingPauseTimePercent=5 - -XX:SurvivorRatio=32 - -XX:+PerfDisableSharedMem - -XX:MaxTenuringThreshold=1 - -jar - forge-1.12.2-14.23.5.2854.jar - nogui workingDir: /mc/ resources: requests: memory: "8Gi" cpu: "2000m" limits: memory: "12Gi" cpu: "4000m" ports: - name: game containerPort: 25565 protocol: TCP - name: dynmap containerPort: 8123 protocol: TCP - name: webstatus-mod containerPort: 8080 protocol: TCP livenessProbe: httpGet: path: / port: 8123 initialDelaySeconds: 120 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: / port: 8123 initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 volumeMounts: - name: storage mountPath: /mc - name: nginx image: nginx:latest resources: requests: memory: "64Mi" cpu: "50m" limits: memory: "256Mi" cpu: "200m" ports: - containerPort: 80 volumeMounts: - name: nginx-config mountPath: /etc/nginx/nginx.conf subPath: nginx.conf - name: storage mountPath: /mc - name: client-scripts mountPath: /mc/clients/win-install.ps1 subPath: win-install.ps1 - name: client-scripts mountPath: /mc/clients/inject.js subPath: inject.js --- apiVersion: v1 kind: Service metadata: name: minecraft-exporter namespace: minecraft spec: selector: app: minecraft ports: - protocol: TCP port: 19565 targetPort: 19565