apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "kube-scheduler.fullname" . }}-as-kube-scheduler
  labels:
    {{- include "kube-scheduler.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
  name: {{ include "kube-scheduler.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
roleRef:
  kind: ClusterRole
  name: {{ include "kube-scheduler.fullname" . }}
  apiGroup: rbac.authorization.k8s.io

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: {{ include "kube-scheduler.fullname" . }}-as-volume-scheduler
  labels:
    {{- include "kube-scheduler.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
  name: {{ include "kube-scheduler.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
roleRef:
  kind: ClusterRole
  name: system:volume-scheduler
  apiGroup: rbac.authorization.k8s.io