# helm_charts_secret-files.yaml
{{- if .Values.secretFiles }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "traefik.fullname" . }}-secrets
  labels:
    app: {{ template "traefik.name" . }}
    chart: {{ template "traefik.chart" . }}
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
{{- range $filename, $fileContents := .Values.secretFiles }}
  {{ $filename }}: {{ $fileContents | b64enc | quote }}
{{- end }}
{{- end }}