pvc.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
  2. kind: PersistentVolumeClaim
  3. apiVersion: v1
  4. metadata:
  5. name: {{ include "common.names.fullname" . }}
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. {{- if .Values.commonLabels }}
  9. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. {{- if or .Values.persistence.annotations .Values.commonAnnotations }}
  12. annotations:
  13. {{- if .Values.persistence.annotations }}
  14. {{- include "common.tplvalues.render" ( dict "value" .Values.persistence.annotations "context" $ ) | nindent 4 }}
  15. {{- end }}
  16. {{- if .Values.commonAnnotations }}
  17. {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  18. {{- end }}
  19. {{- end }}
  20. spec:
  21. accessModes:
  22. {{- if not (empty .Values.persistence.accessModes) }}
  23. {{- range .Values.persistence.accessModes }}
  24. - {{ . | quote }}
  25. {{- end }}
  26. {{- end }}
  27. resources:
  28. requests:
  29. storage: {{ .Values.persistence.size | quote }}
  30. {{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) | nindent 2 }}
  31. {{- if .Values.persistence.dataSource }}
  32. dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.dataSource "context" $) | nindent 4 }}
  33. {{- end }}
  34. {{- end }}