pvc.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{- if not .Values.server.statefulSet.enabled -}}
  2. {{- if .Values.server.persistentVolume.enabled -}}
  3. {{- if not .Values.server.persistentVolume.existingClaim -}}
  4. apiVersion: v1
  5. kind: PersistentVolumeClaim
  6. metadata:
  7. {{- if .Values.server.persistentVolume.annotations }}
  8. annotations:
  9. {{ toYaml .Values.server.persistentVolume.annotations | indent 4 }}
  10. {{- end }}
  11. labels:
  12. {{- include "prometheus.server.labels" . | nindent 4 }}
  13. name: {{ template "prometheus.server.fullname" . }}
  14. {{ include "prometheus.namespace" . | indent 2 }}
  15. spec:
  16. accessModes:
  17. {{ toYaml .Values.server.persistentVolume.accessModes | indent 4 }}
  18. {{- if .Values.server.persistentVolume.storageClass }}
  19. {{- if (eq "-" .Values.server.persistentVolume.storageClass) }}
  20. storageClassName: ""
  21. {{- else }}
  22. storageClassName: "{{ .Values.server.persistentVolume.storageClass }}"
  23. {{- end }}
  24. {{- end }}
  25. {{- if .Values.server.persistentVolume.volumeBindingMode }}
  26. volumeBindingMode: "{{ .Values.server.persistentVolume.volumeBindingMode }}"
  27. {{- end }}
  28. resources:
  29. requests:
  30. storage: "{{ .Values.server.persistentVolume.size }}"
  31. {{- if .Values.server.persistentVolume.selector }}
  32. selector:
  33. {{- toYaml .Values.server.persistentVolume.selector | nindent 4 }}
  34. {{- end -}}
  35. {{- if .Values.server.persistentVolume.volumeName }}
  36. volumeName: "{{ .Values.server.persistentVolume.volumeName }}"
  37. {{- end -}}
  38. {{- end -}}
  39. {{- end -}}
  40. {{- end -}}