{{- if .Values.pspEnabled }}
apiVersion: {{ template "rbac.apiVersion" . }}
kind: RoleBinding
metadata:
  labels:
    {{- include "prometheus-blackbox-exporter.labels" . | nindent 4 }}
  name: {{ template "prometheus-blackbox-exporter.fullname" . }}
  namespace: {{ template "prometheus-blackbox-exporter.namespace" . }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ template "prometheus-blackbox-exporter.fullname" . }}
subjects:
  - kind: ServiceAccount
    name: {{ template "prometheus-blackbox-exporter.serviceAccountName" . }}
{{- end -}}
