{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
  {{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
  {{- if .Values.serviceAccount.extraLabels }}
{{ toYaml .Values.serviceAccount.extraLabels | indent 4}}
  {{- end }}
{{- with .Values.serviceAccount.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
  name: {{ template "victoria-metrics.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
{{- end }}