{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app.kubernetes.io/name: {{ include "app.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
    k8s-app: {{ include "app.name" . }}
    helm.sh/chart: {{ include "chart.name-version" . }}
  name: {{ include "service-account.name" . }}
  annotations:
  {{- range $key, $value := .Values.serviceAccount.annotations }}
    {{ $key }}: {{ $value | quote }}
  {{- end }}
{{- end }}