# helm_charts_psp-clusterrole.yaml
{{- if .Values.rbac.pspEnabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: {{ template "external-dns.fullname" . }}-psp
  labels: {{ include "external-dns.labels" . | nindent 4 }}
rules:
- apiGroups: ['extensions']
  resources: ['podsecuritypolicies']
  verbs:     ['use']
  resourceNames:
  - {{ template "external-dns.fullname" . }}
{{- end }}