Skip to content

Commit f8dee2a

Browse files
K8s: configure role permissions (#1817)
* configure role permissions * Apply suggestions from code review Co-authored-by: hassankh148 <[email protected]> * review feedback --------- Co-authored-by: hassankh148 <[email protected]>
1 parent 0f11a67 commit f8dee2a

File tree

1 file changed

+70
-3
lines changed

1 file changed

+70
-3
lines changed

content/operate/kubernetes/active-active/global-config.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ The [REAADB API reference]({{<relref "/operate/kubernetes/reference/redis_enterp
4848

4949
This section edits the secrets under the REAADB `.spec.globalConfigurations` section. For more information and all available fields, see the [REAADB API reference]({{<relref "/operate/kubernetes/reference/redis_enterprise_active_active_database_api">}}).
5050

51-
5251
1. On an existing participating cluster, generate a YAML file containing the database secret with the relevant data.
5352

5453
This example shoes a secret named `my-db-secret` with the password `my-password` encoded in base 64.
@@ -87,7 +86,7 @@ This section edits the secrets under the REAADB `.spec.globalConfigurations` sec
8786

8887
1. On each other participating cluster, check the secret status.
8988

90-
``sh
89+
```sh
9190
kubectl get reaadb <reaadb-name> -o=jsonpath='{.status.secretsStatus}'
9291
```
9392

@@ -103,4 +102,72 @@ This section edits the secrets under the REAADB `.spec.globalConfigurations` sec
103102
kubectl apply -f <db-secret-file>
104103
```
105104

106-
1. Repeat the previous two steps on every participating cluster.
105+
1. Repeat the previous two steps on every participating cluster.
106+
107+
## Configure role permissions
108+
109+
You can configure role-based access control (RBAC) permissions for Active-Active databases using the `rolesPermissions` field in the REAADB `.spec.globalConfigurations` section. The role permissions configuration is propagated across all participating clusters, but the underlying roles and Redis ACLs must be manually created on each cluster.
110+
111+
{{<note>}}You must manually create the specified roles and Redis ACLs on all participating clusters before configuring role permissions. The operator only propagates the role permissions configuration—it does not create the underlying roles and ACLs. If roles or ACLs are missing on any cluster, the operator will log errors and dispatch an Event associated with the REAADB object until they are manually created.{{</note>}}
112+
113+
### Prerequisites
114+
115+
Before configuring role permissions:
116+
117+
1. Manually create the required roles and Redis ACLs on all participating clusters using the Redis Enterprise admin console or REST API.
118+
2. Ensure role and ACL names match exactly across all clusters (names are case-sensitive).
119+
3. Verify that roles and ACLs are properly configured on each cluster.
120+
121+
{{<warning>}}The operator does not automatically create or synchronize roles and ACLs across clusters. You are responsible for manually creating identical roles and ACLs on each participating cluster.{{</warning>}}
122+
123+
### Add role permissions to REAADB
124+
125+
1. Create or update your REAADB custom resource to include `rolesPermissions` in the global configurations.
126+
127+
Example REAADB with role permissions:
128+
129+
```yaml
130+
apiVersion: app.redislabs.com/v1alpha1
131+
kind: RedisEnterpriseActiveActiveDatabase
132+
metadata:
133+
name: reaadb-boeing
134+
spec:
135+
globalConfigurations:
136+
databaseSecretName: <my-secret>
137+
memorySize: 200MB
138+
shardCount: 3
139+
rolesPermissions:
140+
- role: <role-name>
141+
acl: <acl-name>
142+
type: redis-enterprise
143+
participatingClusters:
144+
- name: rerc-ohare
145+
- name: rerc-reagan
146+
```
147+
148+
Replace `<role-name>` and `<acl-name>` with the exact names of your Redis Enterprise role and ACL.
149+
150+
2. Apply the REAADB custom resource:
151+
152+
```sh
153+
kubectl apply -f <reaadb-file>
154+
```
155+
156+
Alternatively, patch an existing REAADB to add role permissions:
157+
158+
```sh
159+
kubectl patch reaadb <reaadb-name> --type merge --patch \
160+
'{"spec": {"globalConfigurations": {"rolesPermissions": [{"role": "<role-name>", "acl": "<acl-name>", "type": "redis-enterprise"}]}}}'
161+
```
162+
163+
3. After the REAADB is active and its replication status is "Up", verify role permissions are applied to the local database using the Redis Enterprise REST API. See [Database requests]({{<relref "/operate/rs/references/rest-api/requests/bdbs#get-bdbs">}}) for details.
164+
165+
### Troubleshooting role permissions
166+
167+
If you encounter issues with role permissions:
168+
169+
- **Missing role or ACL errors**: Manually create the specified roles and ACLs on all participating clusters with exact name matches. The operator cannot create these automatically.
170+
- **Permission propagation failures**: Verify that the roles and ACLs are properly configured and accessible on each cluster. Remember that you must manually create identical roles and ACLs on every participating cluster.
171+
- **Case sensitivity issues**: Verify that role and ACL names match exactly, including capitalization, across all clusters.
172+
173+
For more details on the `rolesPermissions` field structure, see the [REAADB API reference]({{<relref "/operate/kubernetes/reference/redis_enterprise_active_active_database_api#specglobalconfigurationsrolespermissions">}}).

0 commit comments

Comments
 (0)