ceph: add rbac for mgr to create service monitor

When there are two mgr daemons, a sidecar of the mgr will update the
service monitor depending on the active mgr daemon. When there is only
a single mgr, the operator will create the service monitor. Now, we
add rbac for the mgr to create these resources.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This commit is contained in:
Travis Nielsen
2021-06-11 16:45:51 -06:00
parent 331aaea30c
commit 66dba4fd41
@@ -70,3 +70,39 @@ subjects:
namespace: rook-ceph
# OLM: END ROLE BINDING
---
# OLM: BEGIN ROLE
# Allow management of monitoring resources in the mgr
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rook-ceph-monitor-mgr
namespace: rook-ceph
rules:
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- get
- list
- create
- update
# OLM: END ROLE
---
# OLM: BEGIN ROLE BINDING
# Allow creation of monitoring resources in the mgr
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rook-ceph-monitor-mgr
namespace: rook-ceph
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: rook-ceph-monitor-mgr
subjects:
- kind: ServiceAccount
name: rook-ceph-mgr
namespace: rook-ceph
# OLM: END ROLE BINDING
---