---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole

metadata:
  name: longhorn-manager

rules:
  - apiGroups:
      - apiextensions.k8s.io
    resources:
      - customresourcedefinitions
    verbs:
      - "*"
  - apiGroups:
      - ""
    resources:
      - "pods"
      - "events"
      - "persistentvolumes"
      - "persistentvolumeclaims"
      - "persistentvolumeclaims/status"
      - "nodes"
      - "proxy/nodes"
      - "pods/log"
      - "secrets"
      - "services"
      - "endpoints"
      - "configmaps"
    verbs:
      - "*"
  - apiGroups:
      - ""
    resources:
      - "namespaces"
    verbs:
      - "get"
      - "list"
  - apiGroups:
      - "apps"
    resources:
      - "daemonsets"
      - "statefulsets"
      - "deployments"
    verbs:
      - "*"
  - apiGroups:
      - "batch"
    resources:
      - "jobs"
      - "cronjobs"
    verbs:
      - "*"
  - apiGroups:
      - "policy"
    resources:
      - "poddisruptionbudgets"
    verbs:
      - "*"
  - apiGroups:
      - "scheduling.k8s.io"
    resources:
      - "priorityclasses"
    verbs:
      - "watch"
      - "list"
  - apiGroups:
      - "storage.k8s.io"
    resources:
      - "storageclasses"
      - "volumeattachments"
      - "csinodes"
      - "csidrivers"
    verbs:
      - "*"
  - apiGroups:
      - "snapshot.storage.k8s.io"
    resources:
      - "volumesnapshotclasses"
      - "volumesnapshots"
      - "volumesnapshotcontents"
      - "volumesnapshotcontents/status"
    verbs:
      - "*"
  - apiGroups:
      - "longhorn.io"
    resources:
      - "volumes"
      - "volumes/status"
      - "engines"
      - "engines/status"
      - "replicas"
      - "replicas/status"
      - "settings"
      - "engineimages"
      - "engineimages/status"
      - "nodes"
      - "nodes/status"
      - "instancemanagers"
      - "instancemanagers/status"
      - "sharemanagers"
      - "sharemanagers/status"
      - "backingimages"
      - "backingimages/status"
      - "backingimagemanagers"
      - "backingimagemanagers/status"
    verbs:
      - "*"
  - apiGroups:
      - "coordination.k8s.io"
    resources:
      - "leases"
    verbs:
      - "*"
  - apiGroups:
      - "metrics.k8s.io"
    resources:
      - "pods"
      - "nodes"
    verbs:
      - "get"
      - "list"

...
