infra4talos/apps-helm/samba4/templates/pvc.yaml

64 lines
2.2 KiB
YAML
Raw Permalink Normal View History

{{ $fullName := include "samba4.fullname" . }}
{{- if and .Values.persistence.enabled ( eq .Values.persistence.type "pvc") -}}
{{- if not .Values.persistence.pvc.existingClaim -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ $fullName }}-data
spec:
accessModes:
- {{ .Values.persistence.pvc.accessMode | default "ReadWriteOnce" | quote }}
resources:
requests:
storage: {{ .Values.persistence.pvc.size | default "8Gi" | quote }}
{{- if .Values.persistence.pvc.storageClass }}
{{- if (eq "-" .Values.persistence.pvc.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.pvc.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
{{- range .Values.persistence.extraPVCShares }}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ $fullName }}-{{ .name }}
spec:
accessModes:
- {{ .accessMode | default "ReadWriteOnce" | quote }}
resources:
requests:
storage: {{ .size | default "8Gi" | quote }}
{{- if .storageClass }}
{{- if (eq "-" .storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .storageClass }}"
{{- end }}
{{- end }}
{{- end }}
{{- end }}
---
{{- if .Values.privatePersistence.enabled }}
{{- if and (eq (.Values.privatePersistence.type | default .Values.persistence.type) "pvc") (not .Values.privatePersistence.pvc.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ $fullName }}-private
spec:
accessModes:
- {{ .Values.privatePersistence.pvc.accessMode | default .Values.persistence.pvc.accessMode | default "ReadWriteOnce" | quote }}
resources:
requests:
storage: {{ .Values.privatePersistence.pvc.size | default .Values.persistence.pvc.size | default "20Mi" | quote }}
{{- if .Values.privatePersistence.pvc.storageClass }}
{{- if (eq "-" (.Values.privatePersistence.pvc.storageClass | default .Values.persistence.pvc.storageClass)) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.privatePersistence.pvc.storageClass | default .Values.persistence.pvc.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
{{- end }}