{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "filebeat.serviceAccountName" . }}
  labels:
    app: {{ template "filebeat.name" . }}
    chart: {{ template "filebeat.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
{{- end -}}
