apiVersion: v1
kind: Secret
metadata:
  name: {{ template "filebeat.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ template "filebeat.name" . }}
    helm.sh/chart: {{ template "filebeat.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
  filebeat.yml: {{ toYaml (default .Values.config .Values.overrideConfig) | indent 4 | b64enc }}
  {{- if .Values.extraSecrets }}
  {{- range $key, $value := .Values.extraSecrets }}
  {{ $key }}: {{ $value | b64enc }}
  {{- end -}}

  {{ end }}
