softplayer-helm-lib/charts/workload/templates/deployment/_volumes.tpl

32 lines
1.2 KiB
Smarty

{{- define "helper.deployment.volumes" -}} {{- /* (define) */ -}}
{{- if or ( or .Values.storage .Values.extraVolumes) .Values.files }} {{- /* (1)*/}}
volumes:
{{- /* If storage is defined, mount the pvc */ -}}
{{- if .Values.storage }} {{- /* (2) */}}
{{- range $k, $v := .Values.storage }} {{- /* (3) */}}
- name: {{ $k }}-storage
persistentVolumeClaim:
claimName: " {{- printf "%s-%s" (include "chart.fullname" $) $k }}"
{{- end }} {{- /* /(3) */}}
{{- end }} {{- /* /(2) */}}
{{- if .Values.extraVolumes}} {{- /* (2) */}}
{{- range $k, $v := .Values.extraVolumes}} {{- /* (3) */}}
- name: {{ $k }}-extra
{{- $v | toYaml | nindent 4 }}
{{- end }} {{- /* /(3) */}}
{{- end }} {{- /* /(2) */}}
{{- if .Values.files }} {{- /* (2) */}}
{{- range $k, $v := .Values.files }} {{- /* (3) */}}
- name: {{ $k }}-file
{{- if $v.sensitive }} {{- /* (4) */}}
secret:
defaultMode: 420
secretName: "{{ printf "%s-%s" (include "chart.fullname" $) $k }}"
{{- else }}
configMap:
name: "{{- printf "%s-%s" (include "chart.fullname" $) $k }}"
{{- end }} {{- /* /(4) */}}
{{- end }} {{- /* /(3) */}}
{{- end }} {{- /* /(2) */}}
{{- end -}} {{- /* /(1)*/ -}}
{{- end -}} {{- /* /(define) */ -}}