apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
spec:
  selector:
    matchLabels:
      app: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app: {{ .Release.Name }}
    spec:
      containers:
      - name: {{ .Release.Name }}
        image: {{ .Values.image }}:{{ .Values.tag }}
        ports:
        - containerPort: 25565
        volumeMounts:
        - mountPath: /mc_data
          name: data
        tty: true
        stdin: true
        env:
        - name: MAX_RAM
          value: "4"
        - name: MIN_RAM
          value: "1"
        - name: THREADS
          value: "4"
        resources:
          requests:
            memory: "2Gi"
            cpu: 250m
          limits:
            memory: "4Gi"
            cpu: "4"
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: {{ .Release.Name }}
