From 6ee513c363f08eabcd480bbfc91c811bcf73a25a Mon Sep 17 00:00:00 2001 From: Jon Ervine Date: Sat, 13 Feb 2021 22:10:05 +0800 Subject: [PATCH] Added PVC --- gitea/Chart.yaml | 2 +- gitea/templates/statefulset.yaml | 12 +++++++++++- gitea/values.yaml | 7 +++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gitea/Chart.yaml b/gitea/Chart.yaml index 4512293..386cc46 100644 --- a/gitea/Chart.yaml +++ b/gitea/Chart.yaml @@ -14,7 +14,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. -version: 0.1.4 +version: 0.1.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/gitea/templates/statefulset.yaml b/gitea/templates/statefulset.yaml index 2859fb2..5a4d6b9 100644 --- a/gitea/templates/statefulset.yaml +++ b/gitea/templates/statefulset.yaml @@ -56,6 +56,14 @@ spec: volumeMounts: - name: gitea-pv mountPath: /data + volumes: + {{- if and .Values.config.persistence.enabled .Values.config.persistence.existingClaim }} + - name: gitea-pv + persistentVolumeClaim: + {{- with .Values.config.persistence.existingClaim }} + claimName: {{ tpl . $ }} + {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -68,6 +76,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- if and .Values.config.persistence.enabled (not .Values.config.persistence.existingClaim) }} volumeClaimTemplates: - metadata: name: gitea-pv @@ -77,4 +86,5 @@ spec: resources: requests: storage: {{ .Values.config.storageSize }} - storageClassName: {{ .Values.config.storageClassName | quote }} + storageClassName: {{ .Values.config.persistence.storageClassName | quote }} +{{= end -}} diff --git a/gitea/values.yaml b/gitea/values.yaml index 3735325..e5a93ee 100644 --- a/gitea/values.yaml +++ b/gitea/values.yaml @@ -72,5 +72,8 @@ tolerations: [] affinity: {} config: - storageClassName: nfs-client-hestia - storageSize: 20Gi + persistence: + enabled: true + existingClaim: gitea-data + storageClassName: nfs-client-icarus + storageSize: 20Gi