Skip to content

Commit 4a5a9e3

Browse files
condense troubleshooting, revise security considerations
1 parent 9cec125 commit 4a5a9e3

File tree

1 file changed

+49
-128
lines changed

1 file changed

+49
-128
lines changed

content/operate/kubernetes/logs/log-collector-rbac.md

Lines changed: 49 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -19,124 +19,67 @@ The Redis Enterprise log collector script helps gather diagnostic information fo
1919
- **Restricted mode**: Collects only Redis Enterprise-related resources and logs (default for versions 6.2.18-3+)
2020
- **All mode**: Collects comprehensive cluster information including non-Redis resources (default for versions 6.2.12-1 and earlier)
2121

22-
## When to use each mode
22+
## Collection modes
2323

24-
### Restricted mode (recommended)
24+
- **Restricted mode** (recommended): Collects only Redis Enterprise resources with minimal security exposure. Default for versions 6.2.18-3+.
25+
- **All mode**: Collects comprehensive cluster information including nodes, storage classes, and operator resources. Use when specifically requested by Redis Support.
2526

26-
Use restricted mode when:
27-
- You want to minimize security exposure
28-
- Your organization has strict RBAC policies
29-
- You only need Redis Enterprise-specific troubleshooting data
30-
- You're running version 6.2.18-3 or later (default mode)
27+
## RBAC configurations
3128

32-
### All mode
29+
### Restricted mode
3330

34-
Use all mode when:
35-
- You need comprehensive cluster diagnostics
36-
- Redis Support specifically requests additional cluster information
37-
- You're troubleshooting complex issues that may involve non-Redis resources
38-
- You're running version 6.2.12-1 or earlier (default mode)
31+
{{<embed-md "k8s/log_collector_role_restricted_mode.md">}}
3932

40-
## Permission differences
33+
### All mode
4134

42-
The key differences between the two modes:
35+
{{<embed-md "k8s/log_collector_role_all_mode.md">}}
4336

44-
| Resource Category | Restricted Mode | All Mode |
45-
|------------------|----------------|----------|
46-
| **Cluster-level resources** | Limited | Full access |
47-
| **Node information** | ❌ No access | ✅ Full access |
48-
| **Storage classes** | ❌ No access | ✅ Full access |
49-
| **Volume attachments** | ❌ No access | ✅ Full access |
50-
| **Certificate signing requests** | ❌ No access | ✅ Full access |
51-
| **Operator resources** | ❌ No access | ✅ Full access |
52-
| **Istio resources** | ❌ No access | ✅ Full access |
37+
{{< note >}}
38+
For the complete list of resources and permissions required by each mode, refer to the role definitions in the YAML files above.
39+
{{< /note >}}
5340

54-
## Restricted mode RBAC
41+
## Applying RBAC configurations
5542

56-
Use restricted mode for minimal security exposure while still collecting essential Redis Enterprise diagnostics.
43+
### Quick deployment
5744

58-
{{<embed-md "k8s/log_collector_role_restricted_mode.md">}}
45+
Apply the RBAC configuration directly from the GitHub repository:
5946

60-
### Restricted mode permissions
47+
```bash
48+
# For restricted mode (recommended)
49+
kubectl apply -f https://github.com/RedisLabs/redis-enterprise-k8s-docs/raw/master/log_collector/log_collector_restricted_mode_role.yaml \
50+
--namespace <namespace>
6151

62-
The restricted mode provides access to:
52+
# For all mode
53+
kubectl apply -f https://github.com/RedisLabs/redis-enterprise-k8s-docs/raw/master/log_collector/log_collector_role_all_mode.yaml \
54+
--namespace <namespace>
55+
```
6356

64-
**Role permissions (namespace-scoped):**
65-
- **Pods and logs**: Read pod information and access container logs
66-
- **Pod exec**: Execute commands inside containers for diagnostics
67-
- **Core resources**: Access to services, endpoints, ConfigMaps, secrets, and storage resources
68-
- **Workload resources**: Read deployments, StatefulSets, DaemonSets, and jobs
69-
- **Redis Enterprise resources**: Full read access to all Redis Enterprise custom resources
70-
- **Networking**: Read ingress and network policy configurations
71-
- **OpenShift routes**: Read route configurations (for OpenShift environments)
57+
### Namespace requirements
7258

73-
**ClusterRole permissions (cluster-scoped):**
74-
- **Persistent volumes**: Read cluster-wide storage information
75-
- **Namespaces**: Read namespace information
76-
- **RBAC**: Read cluster roles and bindings
77-
- **Custom resource definitions**: Read Redis Enterprise CRDs
78-
- **Admission controllers**: Read ValidatingWebhook configurations
59+
The Role and RoleBinding must be created in every namespace where you need to collect logs. This varies based on your deployment model:
7960

80-
## All mode RBAC
61+
- **Single namespace**: Apply to the namespace where Redis Enterprise runs
62+
- **Multi-namespace with single REC**: Apply to the REC namespace plus each REDB namespace
63+
- **Multi-namespace with multiple RECs**: Apply to each REC namespace
8164

82-
Use all mode when you need comprehensive cluster diagnostics or when specifically requested by Redis Support.
65+
The ClusterRole and ClusterRoleBinding need to be created only once per cluster.
8366

84-
{{<embed-md "k8s/log_collector_role_all_mode.md">}}
67+
{{< note >}}
68+
Each YAML file contains both Role and ClusterRole objects. Running `kubectl apply` installs both components. You can safely run the command multiple times with different namespaces.
69+
{{< /note >}}
8570

86-
### All mode additional permissions
87-
88-
In addition to all restricted mode permissions, all mode provides:
89-
90-
**Additional ClusterRole permissions:**
91-
- **Nodes**: Read cluster node information and status
92-
- **Storage classes**: Read storage class configurations
93-
- **Volume attachments**: Read volume attachment status
94-
- **Certificate signing requests**: Read certificate management information
95-
- **Operator resources**: Read OLM (Operator Lifecycle Manager) resources
96-
- **Istio resources**: Read Istio service mesh configurations
97-
98-
## Role binding
99-
100-
Bind the Role to your service account in each namespace where you want to collect logs.
101-
102-
```yaml
103-
apiVersion: rbac.authorization.k8s.io/v1
104-
kind: RoleBinding
105-
metadata:
106-
name: redis-enterprise-log-collector
107-
namespace: <target-namespace>
108-
subjects:
109-
- kind: ServiceAccount
110-
name: redis-enterprise-log-collector
111-
namespace: <service-account-namespace>
112-
roleRef:
113-
kind: Role
114-
name: redis-enterprise-log-collector
115-
apiGroup: rbac.authorization.k8s.io
116-
```
71+
### Manual deployment
11772

118-
## Cluster role binding
119-
120-
Bind the ClusterRole to your service account for cluster-wide permissions.
121-
122-
```yaml
123-
apiVersion: rbac.authorization.k8s.io/v1
124-
kind: ClusterRoleBinding
125-
metadata:
126-
name: redis-enterprise-log-collector
127-
subjects:
128-
- kind: ServiceAccount
129-
name: redis-enterprise-log-collector
130-
namespace: <service-account-namespace>
131-
roleRef:
132-
kind: ClusterRole
133-
name: redis-enterprise-log-collector
134-
apiGroup: rbac.authorization.k8s.io
73+
If you prefer to apply the configurations manually, save the YAML content to local files and apply them:
74+
75+
```bash
76+
# Save the YAML content to a file
77+
kubectl apply -f log-collector-rbac.yaml --namespace <namespace>
13578
```
13679

13780
## Usage
13881

139-
Apply the appropriate RBAC configuration and role bindings, then run the log collector with the desired mode:
82+
After applying the RBAC configuration, run the log collector:
14083

14184
```bash
14285
# Restricted mode (default for 6.2.18-3+)
@@ -148,48 +91,26 @@ python log_collector.py -m all -n <namespace>
14891

14992
## Security considerations
15093

151-
### Principle of least privilege
94+
- **Use restricted mode** unless you specifically need additional cluster information
95+
- **Limit namespace access** to only where log collection is needed
96+
- **Handle collected data** according to your organization's security policies (logs may contain sensitive information)
15297

153-
- **Start with restricted mode**: Use restricted mode unless you specifically need additional cluster information
154-
- **Limit namespace access**: Only grant permissions in namespaces where log collection is needed
155-
- **Time-bound access**: Consider creating temporary RBAC resources for log collection activities
98+
### Secrets permission explanation
15699

157-
### Sensitive data handling
100+
The RBAC configurations request read access to secrets in the collected namespaces. **Secrets are not collected or included in the log package sent to Redis Support.** This permission is required because:
158101

159-
Both modes collect:
160-
- **Secrets metadata**: Names and types of secrets (not the actual secret values)
161-
- **ConfigMap data**: Configuration information that may contain sensitive settings
162-
- **Pod logs**: Application logs that may contain sensitive information
102+
- The log collector uses Helm commands (`helm list`, `helm get all`) to gather information about Redis Enterprise Helm chart deployments
103+
- Helm stores its deployment metadata in Kubernetes secrets
104+
- For Redis Enterprise charts, this metadata contains only deployment configuration (not sensitive data), but follows Helm's standard storage pattern
163105

164-
Ensure collected logs are handled according to your organization's data security policies.
106+
If your security policies prohibit secrets access, you can remove the secrets permission from the Role, but this will limit the log collector's ability to gather Helm deployment information.
165107

166108
## Troubleshooting
167109

168-
### Permission denied errors
169-
170-
If you encounter permission errors:
171-
172-
1. **Verify RBAC resources**: Ensure roles and bindings are applied correctly
173-
2. **Check service account**: Confirm the service account has the necessary bindings
174-
3. **Validate namespace access**: Ensure role bindings exist in target namespaces
175-
4. **Review mode requirements**: Verify you're using the correct mode for your needs
176-
177-
### Missing resources
178-
179-
If the log collector reports missing resources:
180-
181-
1. **Check cluster role permissions**: Ensure ClusterRole is applied and bound
182-
2. **Verify CRD access**: Confirm access to Redis Enterprise custom resource definitions
183-
3. **Review mode selection**: Consider switching to all mode if additional resources are needed
184-
185-
## Next steps
186-
187-
- [Learn about log collection]({{< relref "/operate/kubernetes/logs/collect-logs" >}})
188-
- [Explore YAML deployment examples]({{< relref "/operate/kubernetes/reference/yaml-examples" >}})
189-
- [Configure monitoring]({{< relref "/operate/kubernetes/re-clusters/connect-prometheus-operator" >}})
110+
If you encounter permission errors, verify that roles and bindings are applied correctly in the target namespaces. For missing resources, ensure the ClusterRole is applied and consider switching to all mode if additional resources are needed.
190111

191112
## Related documentation
192113

193114
- [Collect logs guide]({{< relref "/operate/kubernetes/logs/collect-logs" >}})
194-
- [Kubernetes RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)
115+
- [Kubernetes RBAC documentation](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)
195116
- [Redis Enterprise troubleshooting]({{< relref "/operate/kubernetes/logs" >}})

0 commit comments

Comments
 (0)