{{- if and .Values.pushgateway.enabled .Values.rbac.create -}} apiVersion: {{ template "rbac.apiVersion" . }} kind: ClusterRole metadata: labels: {{- include "prometheus.pushgateway.labels" . | nindent 4 }} name: {{ template "prometheus.pushgateway.fullname" . }} rules: {{- if .Values.podSecurityPolicy.enabled }} - apiGroups: - extensions resources: - podsecuritypolicies verbs: - use resourceNames: - {{ template "prometheus.pushgateway.fullname" . }} {{- else }} [] {{- end }} {{- end }}