{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "rise.serviceAccountName" . }}
  labels:
    {{- include "rise.labels" . | nindent 4 }}
  {{- if or .Values.serviceAccount.annotations .Values.serviceAccount.iamRoleArn }}
  annotations:
    {{- if .Values.serviceAccount.iamRoleArn }}
    eks.amazonaws.com/role-arn: {{ .Values.serviceAccount.iamRoleArn | quote }}
    {{- end }}
    {{- with .Values.serviceAccount.annotations }}
    {{- toYaml . | nindent 4 }}
    {{- end }}
  {{- end }}
{{- end }}
