# permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  labels:
    app.kubernetes.io/name: role
    app.kubernetes.io/instance: leader-election-role
    app.kubernetes.io/component: rbac
    app.kubernetes.io/created-by: amazon-network-policy-controller-k8s
    app.kubernetes.io/part-of: amazon-network-policy-controller-k8s
    app.kubernetes.io/managed-by: kustomize
  name: controller-k8s-leader-election-role
rules:
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    verbs:
      - create
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    resourceNames:
      - amazon-network-policy-controller-k8s
    verbs:
      - get
      - update
      - patch
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - create
      - patch