{{- if .Values.rbac.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "serviceAccount.name" . }}
  namespace: {{ .Release.Namespace }}
{{- if (and .Values.ecr.enabled .Values.ecr.roleArn) }}
  annotations:
    eks.amazonaws.com/role-arn: {{ .Values.ecr.roleArn }}
{{- end }}
  labels:
    app: {{ template "keel.name" . }}
    chart: {{ template "keel.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
{{ end }}