{{- if and .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ template "openebs.fullname" . }}-psp
  labels:
    app: {{ template "openebs.name" . }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "openebs.fullname" . }}-psp
subjects:
  - kind: ServiceAccount
    name: {{ template "openebs.serviceAccountName" . }}
    namespace: {{ $.Release.Namespace }}
{{- end }}

