{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "velero.fullname" . }}-server
  labels:
    {{- include "velero.labels" . | nindent 4 }}
subjects:
  - kind: ServiceAccount
    name: {{ include "velero.serviceAccountName" . }}
    namespace: velero
roleRef:
  kind: ClusterRole
  name: {{ include "velero.fullname" . }}-server
  apiGroup: rbac.authorization.k8s.io
{{- end }}
