{{- if .Values.rbac.create }}
{{- if .Values.rbac.pspEnabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  labels: {{ include "prometheus-node-exporter.labels" . | indent 4 }}
  name: psp-{{ template "prometheus-node-exporter.fullname" . }}
rules:
- apiGroups: ['extensions']
  resources: ['podsecuritypolicies']
  verbs:     ['use']
  resourceNames:
  - {{ template "prometheus-node-exporter.fullname" . }}
{{- end }}
{{- end }}
