Files
the-1122-pack/helm/templates/deploy.yaml
ducoterra dae5a097e9 Fix RAM issue with deploy
A deploy was running the same max ram for both the pod and the java
app. This led to issues where the java app would use its max ram and the
pod would think it was out of memory. It would kill the pod and the
minecraft server with it, often not saving the last few minutes of
progress.

Now the deploy runs 1GiB extra ram than the java app.
2021-09-11 14:08:38 -04:00

53 lines
1.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ .Release.Name }}
strategy:
type: Recreate
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: {{ .Release.Name }}
image: {{ .Values.image }}
ports:
- containerPort: 25565
volumeMounts:
- mountPath: /mc_data
name: data
- name: properties
mountPath: /mc_data/server.properties
subPath: server.properties
- name: properties
mountPath: /mc_data/eula.txt
subPath: eula.txt
tty: true
stdin: true
env:
- name: MAX_RAM
value: {{ .Values.max_ram | quote }}
- name: MIN_RAM
value: "1"
resources:
requests:
memory: {{ div .Values.max_ram 2 }}Gi
cpu: 1m
limits:
memory: {{ add 1 .Values.max_ram }}Gi
cpu: {{ .Values.max_cpu | quote }}
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}
- name: properties
configMap:
name: {{ .Release.Name }}
securityContext:
fsGroup: 2000