{{- if and .Values.prometheus.enabled .Values.prometheus.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "prometheus-operator.prometheus.serviceAccountName" . }} namespace: {{ template "prometheus-operator.namespace" . }} labels: app: {{ template "prometheus-operator.name" . }}-prometheus {{ include "prometheus-operator.labels" . | indent 4 }} {{- if .Values.prometheus.serviceAccount.annotations }} annotations: {{ toYaml .Values.prometheus.serviceAccount.annotations | indent 4 }} {{- end }} imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | indent 2 }} {{- end }}