apiVersion: v1
kind: ServiceAccount
metadata:
  name: rabbitmq
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: rabbitmq
rules:
- apiGroups: 
    - ""
  resources: 
    - endpoints
  verbs: 
    - get
    - list
    - watch
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: rabbitmq
  namespace: rabbits
subjects:
- kind: ServiceAccount
  name: rabbitmq
  namespace: rabbits
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: rabbitmq