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