{{- if and .Values.prometheus.enabled .Values.prometheus.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "kube-prometheus.prometheus.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
  labels: {{- include "kube-prometheus.prometheus.labels" . | nindent 4 }}
  {{- if index .Values.prometheus.serviceAccount "annotations" }}
  annotations: {{- include "tc.v1.common.tplvalues.render" (dict "value" .Values.prometheus.serviceAccount.annotations "context" $) | nindent 4 }}
  {{- end }}
{{- include "kube-prometheus.imagePullSecrets" . }}
{{- end }}
