From 6d82ec3f2581a4e2c6722fc8120f8e792cea3c17 Mon Sep 17 00:00:00 2001 From: Sean Brandt <4678+seanb4t@users.noreply.github.com> Date: Sun, 31 Dec 2023 09:09:45 -0500 Subject: [PATCH 1/2] add subPath support for dataDir and backupDir --- charts/minecraft/templates/deployment.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/charts/minecraft/templates/deployment.yaml b/charts/minecraft/templates/deployment.yaml index 5107cf6..be235a5 100644 --- a/charts/minecraft/templates/deployment.yaml +++ b/charts/minecraft/templates/deployment.yaml @@ -62,7 +62,7 @@ spec: dnsPolicy: {{ .Values.dnsPolicy}} {{- end }} {{- if .Values.dnsConfig }} - dnsConfig: + dnsConfig: {{- toYaml .Values.dnsConfig | nindent 8 }} {{- end }} securityContext: @@ -109,7 +109,7 @@ spec: {{- if ne .Values.mcbackup.backupMethod "rsync" }} {{- template "minecraft.envMap" list "TAR_COMPRESS_METHOD" .Values.mcbackup.compressMethod }} {{- template "minecraft.envMap" list "ZSTD_PARAMETERS" .Values.mcbackup.zstdParameters }} - {{- end }} + {{- end }} {{- if eq .Values.mcbackup.backupMethod "rclone" }} {{- template "minecraft.envMap" list "RCLONE_REMOTE" .Values.mcbackup.rcloneRemote }} {{- template "minecraft.envMap" list "RCLONE_DEST_DIR" .Values.mcbackup.rcloneDestDir }} @@ -152,8 +152,14 @@ spec: - name: datadir mountPath: /data readOnly: true + {{- if (and .Values.persistence.dataDir.enabled .Values.persistence.dataDir.subPath) }} + subPath: {{ .Values.persistence.dataDir.subPath }} + {{- end }} - name: backupdir mountPath: {{ default "/backups" .Values.mcbackup.destDir }} + {{- if (and .Values.mcbackup.persistence.backupDir.enabled .Values.mcbackup.persistence.backupDir.subPath) }} + subPath: {{ .Values.mcbackup.persistence.backupDir.subPath }} + {{- end }} {{- if or (eq .Values.mcbackup.backupMethod "rclone") (eq (include "isResticWithRclone" $) "true") }} - name: rclone-config mountPath: /config/rclone @@ -421,6 +427,9 @@ spec: - name: backupdir mountPath: {{ default "/backups" .Values.mcbackup.destDir }} readOnly: true + {{- if (and .Values.mcbackup.persistence.backupDir.enabled .Values.mcbackup.persistence.backupDir.subPath) }} + subPath: {{ .Values.mcbackup.persistence.backupDir.subPath }} + {{- end }} {{- range .Values.extraVolumes }} {{- if .volumeMounts }} {{- toYaml .volumeMounts | nindent 8 }} @@ -497,7 +506,7 @@ spec: volumeClaimTemplates: {{- if and .Values.persistence.dataDir.enabled (not .Values.persistence.dataDir.existingClaim) }} - metadata: - name: datadir + name: datadir labels: app: {{ template "minecraft.fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" @@ -505,7 +514,7 @@ spec: heritage: "{{ .Release.Service }}" app.kubernetes.io/name: "{{ .Chart.Name }}" app.kubernetes.io/instance: {{ template "minecraft.fullname" . }} - app.kubernetes.io/version: "{{ .Chart.Version }}" + app.kubernetes.io/version: "{{ .Chart.Version }}" annotations: {{- with .Values.persistence.annotations }} {{ toYaml . | nindent 10 }} From 28c02c3d8160bf2fe8db69742553a7b4ef3b9e90 Mon Sep 17 00:00:00 2001 From: Sean Brandt <4678+seanb4t@users.noreply.github.com> Date: Wed, 3 Jan 2024 09:44:55 -0500 Subject: [PATCH 2/2] Update Chart.yaml - bump version --- charts/minecraft/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/minecraft/Chart.yaml b/charts/minecraft/Chart.yaml index 768d46f..624e507 100755 --- a/charts/minecraft/Chart.yaml +++ b/charts/minecraft/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: minecraft -version: 4.14.0 +version: 4.14.1 appVersion: SeeValues home: https://minecraft.net/ description: Minecraft server