From dae5a097e9e896dc9cd02087f616184fb1a9c00a Mon Sep 17 00:00:00 2001 From: ducoterra Date: Sat, 11 Sep 2021 14:08:38 -0400 Subject: [PATCH] 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. --- helm/Chart.yaml | 2 +- helm/templates/deploy.yaml | 10 +++++----- values-camcraft.yaml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 267e7c7..61a1a40 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.1 +version: 1.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm/templates/deploy.yaml b/helm/templates/deploy.yaml index 6f5a27e..a457614 100644 --- a/helm/templates/deploy.yaml +++ b/helm/templates/deploy.yaml @@ -6,8 +6,8 @@ spec: selector: matchLabels: app: {{ .Release.Name }} - updateStrategy: - type: Recreate + strategy: + type: Recreate template: metadata: labels: @@ -33,13 +33,13 @@ spec: - name: MAX_RAM value: {{ .Values.max_ram | quote }} - name: MIN_RAM - value: {{ .Values.max_ram | quote }} + value: "1" resources: requests: - memory: {{ .Values.max_ram }}Gi + memory: {{ div .Values.max_ram 2 }}Gi cpu: 1m limits: - memory: {{ .Values.max_ram }}Gi + memory: {{ add 1 .Values.max_ram }}Gi cpu: {{ .Values.max_cpu | quote }} volumes: - name: data diff --git a/values-camcraft.yaml b/values-camcraft.yaml index d6fde33..da74c4b 100644 --- a/values-camcraft.yaml +++ b/values-camcraft.yaml @@ -1,7 +1,7 @@ image: hub.ducoterra.net/ducoterra/minecraft:1.16.4 port: 20101 max_cpu: 8 -max_ram: 6 +max_ram: 8 server_props: | max-tick-time=60000 generator-settings= @@ -39,4 +39,4 @@ server_props: | prevent-proxy-connections=false use-native-transport=true motd=This is gonna be interesting - enable-rcon=false \ No newline at end of file + enable-rcon=false