Files
chart/library/ix-dev/charts/ix-chart/templates/_volumes.tpl
Stavros Kois fd1415b5ba NAS-121456 / 23.10 / Adds field for emptyDir sizeLimit to ix-chart (#1118)
* Add field for emptyDir size

* add validation

* bump

* add a default sizeLimit

* bump
2023-04-28 15:55:42 +03:00

55 lines
2.0 KiB
Smarty

{{/*
Volumes Configuration
*/}}
{{- define "volumeConfiguration" }}
{{- if or .Values.ixVolumes .Values.hostPathVolumes .Values.emptyDirVolumes }}
volumes:
{{ $host_p := list }}
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
- name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ $host_p = mustAppend $host_p $hostPathConfiguration.hostPath }}
{{- end }}
{{- range $index, $hostPathConfiguration := .Values.ixVolumes }}
{{ $dsName := base $hostPathConfiguration.hostPath }}
- name: ix-host-volume-{{ $.Release.Name }}-{{ $dsName }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ $host_p = mustAppend $host_p $hostPathConfiguration.hostPath }}
{{- end }}
{{ include "common.storage.hostPathsValidation" $host_p }}
{{- range $index, $emptyDirConfiguration := .Values.emptyDirVolumes }}
- name: ix-emptydir-volume-{{ $.Release.Name }}-{{ $index }}
emptyDir:
medium: Memory
{{- with $emptyDirConfiguration.sizeLimit }}
sizeLimit: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Volume Mounts Configuration
*/}}
{{- define "volumeMountsConfiguration" }}
{{- if or .Values.hostPathVolumes .Values.ixVolumes .Values.emptyDirVolumes }}
volumeMounts:
{{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
- mountPath: {{ $hostPathConfiguration.mountPath }}
name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
readOnly: {{ $hostPathConfiguration.readOnly }}
{{- end }}
{{- range $index, $hostPathConfiguration := .Values.volumes }}
- mountPath: {{ $hostPathConfiguration.mountPath }}
name: ix-host-volume-{{ $.Release.Name }}-{{ $hostPathConfiguration.datasetName }}
{{- end }}
{{- range $index, $emptyDirConfiguration := .Values.emptyDirVolumes }}
- mountPath: {{ $emptyDirConfiguration.mountPath }}
name: ix-emptydir-volume-{{ $.Release.Name }}-{{ $index }}
{{- end }}
{{- end }}
{{- end }}