content/operate/kubernetes/7.22/reference/yaml/log-collector-rbac.md
This page provides YAML examples for configuring RBAC permissions for the Redis Enterprise log collector tool. The log collector requires different permission levels depending on the collection mode you choose.
For complete log collection instructions, see [Collect logs]({{< relref "/operate/kubernetes/7.22/logs/collect-logs" >}}).
The log collector has two collection modes that require different RBAC permissions:
restricted mode (recommended): Collects only Redis Enterprise resources with minimal security exposure. Default for versions 6.2.18-3+.all mode: Collects comprehensive cluster information including nodes, storage classes, and operator resources. Use when specifically requested by Redis Support.restricted mode RBACThe restricted mode configuration provides minimal permissions for collecting Redis Enterprise resources only.
{{<embed-yaml "k8s/log_collector_role_restricted_mode.md" "log-collector-restricted-rbac.yaml">}}
restricted mode configuration:
Role: Namespace-scoped permissions for Redis Enterprise resourcesClusterRole: Cluster-wide permissions for CRDs and basic cluster resourcesrules: Minimal permissions for Redis Enterprise diagnosticsKey permissions:
pods, pods/log, pods/exec: Access to pod information and logsapp.redislabs.com/*: All Redis Enterprise custom resourcespersistentvolumes: Storage information for troubleshootingall mode RBACThe all mode configuration provides comprehensive permissions for collecting detailed cluster information.
{{<embed-yaml "k8s/log_collector_role_all_mode.md" "log-collector-all-rbac.yaml">}}
all mode configuration:
Role: Extended namespace permissions including operator resourcesClusterRole: Additional cluster-wide permissions for nodes and storagerules: Comprehensive permissions for full cluster diagnosticsAdditional permissions in all mode:
nodes: Node information and statusstorageclasses, volumeattachments: Storage system detailsoperators.coreos.com/*: OpenShift operator informationnetworking.istio.io/*: Istio service mesh resourcesCreate the Role and RoleBinding in every namespace where you need to collect logs:
The ClusterRole and ClusterRoleBinding need to be created only once per cluster.
Edit the values in the downloaded YAML file for your specific setup, updating the namespace references and role binding subjects to match your environment.
The RBAC configurations include both roles and role bindings. The role bindings must reference the user or service account that will execute the log collector:
subjects section in the RoleBinding and ClusterRoleBinding to reference your usernameTo apply the RBAC configurations manually:
# Apply restricted mode RBAC
kubectl apply -f log-collector-restricted-rbac.yaml --namespace <namespace>
# Apply all mode RBAC
kubectl apply -f log-collector-all-rbac.yaml --namespace <namespace>
After applying the RBAC configuration, run the log collector:
# Restricted mode (default for 6.2.18-3+)
python log_collector.py -m restricted -n <namespace>
# All mode
python log_collector.py -m all -n <namespace>
restricted mode unless you specifically need additional cluster informationThe 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:
helm list, helm get all) to gather Redis Enterprise Helm chart deployment informationIf 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.
all mode if additional cluster resources are needed