Added existing claim support

This commit is contained in:
Jon Ervine 2021-02-13 21:51:49 +08:00
parent 402b64152f
commit accaedf00e
3 changed files with 15 additions and 3 deletions

View File

@ -14,7 +14,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # 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. # to the chart and its templates, including the app version.
version: 0.1.8 version: 0.1.9
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. # incremented each time you make changes to the application.

View File

@ -51,6 +51,13 @@ spec:
secret: secret:
defaultMode: 420 defaultMode: 420
secretName: bedrock-server secretName: bedrock-server
{{- if and .Values.config.persistence.enabled .Values.config.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
{{- with .Values.config.persistence.existingClaim }}
claimName: {{ tpl . $ }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@ -63,6 +70,7 @@ spec:
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- if and .Values.config.persistence.enabled (not .Values.config.persistence.existingClaim) }}
volumeClaimTemplates: volumeClaimTemplates:
- metadata: - metadata:
name: data name: data
@ -72,3 +80,4 @@ spec:
resources: resources:
requests: requests:
storage: {{ .Values.config.storageSize }} storage: {{ .Values.config.storageSize }}
{{- end -}}

View File

@ -67,5 +67,8 @@ tolerations: []
affinity: {} affinity: {}
config: config:
storageClassName: nfs-client-hermes persistence:
storageSize: 10Gi enabled: true
existingClaim: bedrock-data
storageClassName: nfs-client-hermes
storageSize: 10Gi