---
# Dynamic management of leader election leases
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: kyverno:leaderelection
  labels:
    app: kyverno
rules:
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - create
  - delete
  - get
  - patch
  - update
# Allow update of Kyverno deployment annotations
- apiGroups:
    - apps
  resources:
    - deployments
  verbs:
    - get
    - list
    - patch
    - update
    - watch
