Skip to content

Commit b979e97

Browse files
alt role/rolebinding approach for multi-ns (#1785)
1 parent 0732574 commit b979e97

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

content/operate/kubernetes/re-clusters/multi-namespace.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ roleRef:
8989
apiGroup: rbac.authorization.k8s.io
9090
```
9191

92+
{{<note>}}
93+
**Alternative approach**: Instead of creating individual `Role` objects for each namespace, you can create a single `ClusterRole` and bind it with multiple `RoleBinding` objects. This reduces the number of objects and simplifies role management.
94+
95+
To use this approach:
96+
1. Change `kind: Role` to `kind: ClusterRole` in the role definition above
97+
2. Change `roleRef.kind: Role` to `roleRef.kind: ClusterRole` in the role binding definition above
98+
3. Apply the ClusterRole once globally, then apply a RoleBinding in each managed namespace
99+
{{</note>}}
100+
92101
Apply the files, replacing `<managed-namespace>` with your own values:
93102

94103
```sh

0 commit comments

Comments
 (0)