---
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: {{ template "fullname" . }}
roleRef:
  apiGroup: ''
  kind: ClusterRole
  name: {{ template "fullname" . }}
subjects:
  - kind: ServiceAccount
    name: {{ template "fullname" . }}
    namespace: {{ .Release.Namespace }}
{{- end }}
