apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: activemq-artemis-leader-election-role
  labels:
  {{- include "arkmq-org-broker-operator.labels" . | nindent 4 }}
rules:
- apiGroups:
  - ""
  resources:
  - configmaps
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: activemq-artemis-leader-election-rolebinding
  labels:
  {{- include "arkmq-org-broker-operator.labels" . | nindent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: activemq-artemis-leader-election-role
subjects:
- kind: ServiceAccount
  name: activemq-artemis-controller-manager
  namespace: '{{ .Release.Namespace }}'
