Skip to content

add subPath support for dataDir and backupDir #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions charts/minecraft/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
dnsPolicy: {{ .Values.dnsPolicy}}
{{- end }}
{{- if .Values.dnsConfig }}
dnsConfig:
dnsConfig:
{{- toYaml .Values.dnsConfig | nindent 8 }}
{{- end }}
securityContext:
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -497,15 +506,15 @@ 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 }}"
release: "{{ .Release.Name }}"
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 }}
Expand Down