{{- if .Values.ingressMonitorController.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app: {{ template "name" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service | quote }}
{{- if .Values.ingressMonitorController.serviceAccount.labels }}
{{ toYaml .Values.ingressMonitorController.serviceAccount.labels | indent 4 }}
{{- end }}
{{- if .Values.ingressMonitorController.matchLabels }}
{{ toYaml .Values.ingressMonitorController.matchLabels | indent 4 }}
{{- end }}
  name: {{ template "serviceAccountName" . }}
{{- end }}