apiVersion: v1
kind: ServiceAccount
metadata:
  name: openstack-manila-csi-nodeplugin
  labels:
    app: openstack-manila-csi
    component: nodeplugin
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openstack-manila-csi-nodeplugin
  labels:
    app: openstack-manila-csi
    component: nodeplugin
aggregationRule:
  clusterRoleSelectors:
    - matchLabels:
        rbac.manila.csi.openstack.org/aggregate-to-openstack-manila-csi-nodeplugin: "true"
rules: []
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openstack-manila-csi-nodeplugin-rules
  labels:
    app: openstack-manila-csi
    component: nodeplugin
    rbac.manila.csi.openstack.org/aggregate-to-openstack-manila-csi-nodeplugin: "true"
rules:
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["get", "list"]
  - apiGroups: [""]
    resources: ["nodes"]
    verbs: ["get", "list", "update"]
  - apiGroups: [""]
    resources: ["namespaces"]
    verbs: ["get", "list"]
  - apiGroups: [""]
    resources: ["persistentvolumes"]
    verbs: ["get", "list", "watch", "update"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openstack-manila-csi-nodeplugin
  labels:
    app: openstack-manila-csi
    component: nodeplugin
subjects:
  - kind: ServiceAccount
    name: openstack-manila-csi-nodeplugin
    namespace: default
roleRef:
  kind: ClusterRole
  name: openstack-manila-csi-nodeplugin
  apiGroup: rbac.authorization.k8s.io
