diff --git a/deploy/charts/library/templates/_cluster-role.tpl b/deploy/charts/library/templates/_cluster-role.tpl index cf12c4c5e..1f23d09ce 100644 --- a/deploy/charts/library/templates/_cluster-role.tpl +++ b/deploy/charts/library/templates/_cluster-role.tpl @@ -20,6 +20,15 @@ rules: resources: ["cephclusters", "cephclusters/finalizers"] verbs: ["get", "list", "create", "update", "delete"] --- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: rook-ceph-rgw + namespace: {{ .Release.Namespace }} # namespace:cluster +rules: + # Placeholder role so the rgw service account will + # be generated in the csv +--- # Aspects of ceph-mgr that operate within the cluster's namespace kind: Role apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/charts/library/templates/_cluster-rolebinding.tpl b/deploy/charts/library/templates/_cluster-rolebinding.tpl index b9748d401..dc5e05f29 100644 --- a/deploy/charts/library/templates/_cluster-rolebinding.tpl +++ b/deploy/charts/library/templates/_cluster-rolebinding.tpl @@ -32,6 +32,21 @@ subjects: name: rook-ceph-osd namespace: {{ .Release.Namespace }} # namespace:cluster --- +# Allow the rgw pods in this namespace to work with configmaps +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: rook-ceph-rgw + namespace: {{ .Release.Namespace }} # namespace:cluster +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: rook-ceph-rgw +subjects: + - kind: ServiceAccount + name: rook-ceph-rgw + namespace: {{ .Release.Namespace }} # namespace:cluster +--- # Allow the ceph mgr to access resources scoped to the CephCluster namespace necessary for mgr modules kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/examples/common.yaml b/deploy/examples/common.yaml index 833ee1602..25c0ccb97 100644 --- a/deploy/examples/common.yaml +++ b/deploy/examples/common.yaml @@ -1005,6 +1005,15 @@ rules: resources: ["persistentvolumeclaims"] verbs: ["get", "update", "delete", "list"] --- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: rook-ceph-rgw + namespace: rook-ceph # namespace:cluster +rules: +# Placeholder role so the rgw service account will +# be generated in the csv +--- # Allow the operator to manage resources in its own namespace apiVersion: rbac.authorization.k8s.io/v1 kind: Role @@ -1251,6 +1260,21 @@ subjects: name: rook-ceph-purge-osd namespace: rook-ceph # namespace:cluster --- +# Allow the rgw pods in this namespace to work with configmaps +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: rook-ceph-rgw + namespace: rook-ceph # namespace:cluster +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: rook-ceph-rgw +subjects: + - kind: ServiceAccount + name: rook-ceph-rgw + namespace: rook-ceph # namespace:cluster +--- # Grant the operator, agent, and discovery agents access to resources in the rook-ceph-system namespace kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1