From 3faf99747aafa59a39adcaaa87dc7a6aa66bd871 Mon Sep 17 00:00:00 2001 From: Joe Stanton Date: Sun, 7 Jun 2020 22:17:46 -0400 Subject: [PATCH] [stable/minecraft] Added option to use existing persistentVolumeClaim (#22654) Signed-off-by: Joseph Stanton --- stable/minecraft/Chart.yaml | 2 +- stable/minecraft/templates/datadir-pvc.yaml | 2 +- stable/minecraft/templates/deployment.yaml | 4 ++++ stable/minecraft/values.yaml | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/stable/minecraft/Chart.yaml b/stable/minecraft/Chart.yaml index 81d598870b..f262eaed9d 100755 --- a/stable/minecraft/Chart.yaml +++ b/stable/minecraft/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: minecraft -version: 1.2.3 +version: 1.2.4 appVersion: 1.14.4 home: https://minecraft.net/ description: Minecraft server diff --git a/stable/minecraft/templates/datadir-pvc.yaml b/stable/minecraft/templates/datadir-pvc.yaml index 2225a94445..d03e11ac99 100644 --- a/stable/minecraft/templates/datadir-pvc.yaml +++ b/stable/minecraft/templates/datadir-pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.persistence.dataDir.enabled -}} +{{- if and .Values.persistence.dataDir.enabled (not .Values.persistence.dataDir.existingClaim ) -}} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/stable/minecraft/templates/deployment.yaml b/stable/minecraft/templates/deployment.yaml index 859cedcc31..b437de4701 100644 --- a/stable/minecraft/templates/deployment.yaml +++ b/stable/minecraft/templates/deployment.yaml @@ -201,7 +201,11 @@ spec: - name: datadir {{- if .Values.persistence.dataDir.enabled }} persistentVolumeClaim: + {{- if .Values.persistence.dataDir.existingClaim }} + claimName: {{ .Values.persistence.dataDir.existingClaim }} + {{- else }} claimName: {{ template "minecraft.fullname" . }}-datadir + {{- end }} {{- else }} emptyDir: {} {{- end }} diff --git a/stable/minecraft/values.yaml b/stable/minecraft/values.yaml index e9a58a221e..6f5bd7962d 100644 --- a/stable/minecraft/values.yaml +++ b/stable/minecraft/values.yaml @@ -173,6 +173,7 @@ persistence: dataDir: # Set this to false if you don't care to persist state between restarts. enabled: true + # existingClaim: nil Size: 1Gi podAnnotations: {}