apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: open-cluster-management:cluster-proxy:addon-manager
rules:
  - apiGroups:
      - cluster.open-cluster-management.io
    resources:
      - managedclusters
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - addon.open-cluster-management.io
    resources:
      - clustermanagementaddons
      - managedclusteraddons
      - clustermanagementaddons/status
      - managedclusteraddons/status
    verbs:
      - get
      - list
      - watch
      - update
      - patch
  - apiGroups:
      - proxy.open-cluster-management.io
    resources:
      - managedproxyconfigurations
      - managedproxyconfigurations/status
    verbs:
      - get
      - list
      - watch
      - update
      - patch
  - apiGroups:
      - certificates.k8s.io
    resources:
      - certificatesigningrequests
      - certificatesigningrequests/approval
      - certificatesigningrequests/status
    verbs:
      - get
      - list
      - watch
      - update
      - patch
  - apiGroups:
      - certificates.k8s.io
    resources:
      - signers
    verbs:
      - "*"
    resourceNames:
      - open-cluster-management.io/proxy-agent-signer
      - kubernetes.io/kube-apiserver-client
  - apiGroups:
      - ""
    resources:
      - namespaces
      - secrets
    verbs:
      - "*"
  - apiGroups:
      - ""
    resources:
      - serviceaccounts
      - services
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - apps
    resources:
      - deployments
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - rbac.authorization.k8s.io
    resources:
      - roles
      - rolebindings
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
  - apiGroups:
      - work.open-cluster-management.io
    resources:
      - manifestworks
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    verbs:
      - "*"