Dominic Lunanuova | 50aafc5 | 2018-03-30 02:29:23 +0000 | [diff] [blame] | 1 | {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} |
| 2 | kind: PersistentVolumeClaim |
| 3 | apiVersion: v1 |
| 4 | metadata: |
| 5 | name: {{ template "postgresql.fullname" . }} |
| 6 | labels: |
| 7 | app: {{ template "postgresql.fullname" . }} |
| 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 9 | release: "{{ .Release.Name }}" |
| 10 | heritage: "{{ .Release.Service }}" |
| 11 | {{- if .Values.persistence.annotations }} |
| 12 | annotations: |
| 13 | {{ toYaml .Values.persistence.annotations | indent 4 }} |
| 14 | {{- end }} |
| 15 | spec: |
| 16 | accessModes: |
| 17 | - {{ .Values.persistence.accessMode | quote }} |
| 18 | resources: |
| 19 | requests: |
| 20 | storage: {{ .Values.persistence.size | quote }} |
| 21 | {{- if .Values.persistence.storageClass }} |
| 22 | {{- if (eq "-" .Values.persistence.storageClass) }} |
| 23 | storageClassName: "" |
| 24 | {{- else }} |
| 25 | storageClassName: "{{ .Values.persistence.storageClass }}" |
| 26 | {{- end }} |
| 27 | {{- end }} |
| 28 | {{- end -}} |