---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: hpe-dynamic-provisioner-role
  namespace: kube-system
rules:
  - apiGroups: ["storage.k8s.io"]
    resources: ["storageclasses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["persistentvolumeclaims"]
    verbs: ["get", "list", "watch", "update"]
  - apiGroups: [""]
    resources: ["persistentvolumes"]
    verbs: ["get", "list", "watch", "create", "delete", "update"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["list", "watch", "create", "update", "patch"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: hpe-dynamic-provisioner-binding
subjects:
  - kind: ServiceAccount
    name: hpe-flexvolume-sa
    namespace: kube-system
roleRef:
  kind: ClusterRole
  name: hpe-dynamic-provisioner-role
  apiGroup: rbac.authorization.k8s.io

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: hpe-flexvolume-sa
  namespace: kube-system