{{- if and (.Values.persistence.enabled) (not .Values.persistence.existingClaim) }} kind: PersistentVolumeClaim apiVersion: v1 metadata: name: {{ printf "rustus-data-%s" (include "rustus.fullname" .) }} labels: {{- include "rustus.selectorLabels" . | nindent 4 }} {{- if .Values.persistence.annotations }} annotations: {{- toYaml .Values.persistence.annotations | nindent 4 }} {{- end }} spec: storageClassName: {{ .Values.persistence.storageClass }} accessModes: {{- range .Values.persistence.accessModes }} - {{ . | quote }} {{- end }} {{- with .Values.persistence.dataSource }} dataSource: {{ . | toYaml | nindent 4 }} {{- end }} {{- with .Values.persistence.selector }} selector: {{- . | toYaml | nindent 4 }} {{- end }} mountOptions: {{- .Values.persistence.mountOptions | toYaml | nindent 4 }} resources: requests: storage: {{ .Values.persistence.size | quote }} {{- end }}