{{- range $k, $v := .Values.secretFiles }} --- apiVersion: v1 kind: Secret metadata: name: {{ $k }} namespace: {{ $.Release.Namespace }} labels: app: {{ $.Values.name }} chart: {{ template "chart.chart" $ }} release: {{ $.Release.Name }} heritage: {{ $.Release.Service }} type: Opaque data: file: {{ $v }} {{- end }} {{- if $.Values.secrets }} --- apiVersion: v1 kind: Secret metadata: name: {{ $.Values.name }}-secrets namespace: {{ $.Release.Namespace }} labels: app: {{ $.Values.name }} chart: {{ template "chart.chart" $ }} release: {{ $.Release.Name }} heritage: {{ $.Release.Service }} type: Opaque data: {{- range $k, $v := $.Values.secrets }} {{ $k }}: "{{ $v | b64enc }}" {{- end }} {{- end }}