Files
truecharts/charts/traefik/0.1.1/templates/custom/_appStorage.tpl
T
kjeld Schouten-Lebbing 6ab34757aa Add Traefik Ingress Chart
Important notes:
- Uses 80 and 443 for primary ingress, but warns about such when installing
- Currently entrypoints are hardcoded, PR's are welcome to change this.

(thanks to co-author for fixing the icon url)
Co-authored-by: Stavros Kois <stavros-k@users.noreply.github.com>
Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
2021-02-07 19:23:17 +01:00

53 lines
1.4 KiB
Smarty

{{/*
Retrieve host path from ix volumes based on dataset name
*/}}
{{- define "retrieveHostPathFromiXVolume" -}}
{{- range $index, $hostPathConfiguration := $.ixVolumes }}
{{- $dsName := base $hostPathConfiguration.hostPath -}}
{{- if eq $.datasetName $dsName -}}
{{- $hostPathConfiguration.hostPath -}}
{{- end }}
{{- end }}
{{- end -}}
{{/*
Define appVolumeMounts for container
*/}}
{{- define "configuredAppVolumeMounts" -}}
{{- if and .Values.appVolumesEnabled .Values.appVolumeMounts }}
{{- range $name, $avm := .Values.appVolumeMounts -}}
{{- if $avm.enabled }}
- name: {{ $name }}
mountPath: {{ $avm.mountPath }}
{{- if $avm.subPath }}
subPath: {{ $avm.subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
{{/*
Define hostPath for appVolumes
*/}}
{{- define "configuredAppVolumes" -}}
{{- if and .Values.appVolumesEnabled .Values.appVolumeMounts }}
{{- range $name, $av := .Values.appVolumeMounts -}}
{{- if $av.enabled }}
- name: {{ $name }}
{{- if or $av.emptyDir $.Values.emptyDirVolumes }}
emptyDir: {}
{{- else }}
hostPath:
{{ if $av.hostPathEnabled }}
path: {{ required "hostPath not set" $av.hostPath }}
{{- else }}
{{- $volDict := dict "datasetName" $av.datasetName "ixVolumes" $.Values.ixVolumes -}}
path: {{ include "retrieveHostPathFromiXVolume" $volDict }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}