{{ if .Values.global.prometheus.enabled }} {{- if and .Values.prometheus.server.enabled .Values.prometheus.rbac.create -}} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: labels: {{- include "prometheus.server.labels" . | nindent 4 }} name: {{ template "prometheus.server.fullname" . }} subjects: - kind: ServiceAccount name: {{ template "prometheus.serviceAccountName.server" . }} namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: {{ template "prometheus.server.fullname" . }} {{- end }} {{ end }}