From 5a182047ab684c54ed23908c8240dca8cf0c21df Mon Sep 17 00:00:00 2001 From: Kaitlyn Michael Date: Thu, 24 Jul 2025 14:41:33 -0500 Subject: [PATCH 1/4] K8s: Add comprehensive log collector options documentation - Replace brief option mentions with complete options table - Include all 12 available command-line options with descriptions - Add CLI configuration prerequisite step - Add RBAC requirements section - Follows same documentation pattern as other CLI tools --- .../operate/kubernetes/logs/collect-logs.md | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/content/operate/kubernetes/logs/collect-logs.md b/content/operate/kubernetes/logs/collect-logs.md index 808649ea3c..f0ef84fc8c 100644 --- a/content/operate/kubernetes/logs/collect-logs.md +++ b/content/operate/kubernetes/logs/collect-logs.md @@ -24,18 +24,37 @@ As of version 6.2.18-3, the log collector tool has two modes: 1. Download the latest [`log_collector.py`](https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/log_collector/log_collector.py) file. +1. Ensure your `kubectl` or `oc` CLI is configured to access the Kubernetes cluster you want to collect logs from. + 1. Have a K8s administrator run the script on the system that runs your `kubectl` or `oc` commands. - - Pass `-n` parameter to run on a different namespace than the one you are currently on - - Pass `-m` parameter to change the log collector mode (`all` or `restricted`) - - Run with `-h` to see more options ```bash - python log_collector.py + python log_collector.py ``` - {{< note >}} If you get an error because the yaml module is not found, install the pyYAML module with `pip install pyyaml`. - {{< /note >}} +## Options + +You can run `log_collector.py` with the following options: +| Option | Description | +|--------|-------------| +| `-n`, `--namespace` | Sets the namespace(s) to collect from. Can be set to a single namespace, or multiple namespaces (comma-separated). When left empty, will use the current context's namespace from kubeconfig. | +| `-o`, `--output_dir` | Sets the output directory. Defaults to current working directory. | +| `-a`, `--logs_from_all_pods` | Collect logs from all pods in the selected namespace(s), and otherwise collect only from the operator and pods run by the operator. | +| `-t`, `--timeout` | Time to wait for external commands to finish execution (Linux only). Default to 180s. Specify 0 to disable timeout. | +| `--k8s_cli` | The K8s cli client to use (kubectl/oc/auto-detect). Defaults to auto-detect (chooses between 'kubectl' and 'oc'). Full paths can also be used. | +| `-m`, `--mode` | Controls which resources are collected. In 'restricted' mode, only resources associated with the operator and have the label 'app=redis-enterprise' are collected. In 'all' mode, all resources are collected. Defaults to 'restricted' mode. | +| `--collect_istio` | Collect data from istio-system namespace to debug potential problems related to istio ingress method. | +| `--collect_empty_files` | Collect empty log files for missing resources. | +| `--helm_release_name` | Collect resources related to the given Helm release name. | +| `--collect_rbac_resources` | Temporary development flag. Collect all role based access control related custom resources. | +| `-h`, `--help` | Show help message and exit. | +{{< note >}} If you get an error because the yaml module is not found, install the pyYAML module with `pip install pyyaml`. +{{< /note >}} 1. Upload the resulting `tar.gz` file containing all the logs to [Redis Support](https://support.redislabs.com/). + +## RBAC requirements + +The log collector requires specific RBAC permissions depending on the collection mode. Contact your Kubernetes administrator to ensure the appropriate permissions are configured for your chosen collection mode. From faa41804450aaef2d0b0f83f9e8a8b0f9f7119c6 Mon Sep 17 00:00:00 2001 From: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:43:52 -0500 Subject: [PATCH 2/4] Apply suggestions from code review --- content/operate/kubernetes/logs/collect-logs.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/operate/kubernetes/logs/collect-logs.md b/content/operate/kubernetes/logs/collect-logs.md index f0ef84fc8c..0327b5a9cd 100644 --- a/content/operate/kubernetes/logs/collect-logs.md +++ b/content/operate/kubernetes/logs/collect-logs.md @@ -55,6 +55,4 @@ You can run `log_collector.py` with the following options: 1. Upload the resulting `tar.gz` file containing all the logs to [Redis Support](https://support.redislabs.com/). -## RBAC requirements -The log collector requires specific RBAC permissions depending on the collection mode. Contact your Kubernetes administrator to ensure the appropriate permissions are configured for your chosen collection mode. From e84d5f51ea51a828ff1ea04eb91b9787a81f4704 Mon Sep 17 00:00:00 2001 From: Kaitlyn Michael Date: Thu, 24 Jul 2025 14:45:49 -0500 Subject: [PATCH 3/4] remove 6.2.18 mention --- content/operate/kubernetes/logs/collect-logs.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/operate/kubernetes/logs/collect-logs.md b/content/operate/kubernetes/logs/collect-logs.md index 0327b5a9cd..af57e10191 100644 --- a/content/operate/kubernetes/logs/collect-logs.md +++ b/content/operate/kubernetes/logs/collect-logs.md @@ -13,12 +13,10 @@ weight: 89 The Redis Enterprise cluster (REC) log collector script ([`log_collector.py`](https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/log_collector/log_collector.py)) creates and fills a directory with the relevant logs for your environment. These logs will help the support team with troubleshooting. -As of version 6.2.18-3, the log collector tool has two modes: +The log collector tool has two modes: - **restricted** collects only resources and logs created by the operator and Redis Enterprise deployments - - This is the default for versions 6.2.18-3 and later - **all** collects everything from your environment - - This is the default mode for versions 6.2.12-1 and earlier {{}} This script requires Python 3.6 or later. {{}} From e9a3dc14ac1399a49d0280f0c0f58dcbc284ad35 Mon Sep 17 00:00:00 2001 From: Kaitlyn Michael <76962844+kaitlynmichael@users.noreply.github.com> Date: Thu, 24 Jul 2025 16:08:49 -0500 Subject: [PATCH 4/4] Update content/operate/kubernetes/logs/collect-logs.md Co-authored-by: David Dougherty --- content/operate/kubernetes/logs/collect-logs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/operate/kubernetes/logs/collect-logs.md b/content/operate/kubernetes/logs/collect-logs.md index af57e10191..a6ac9fef24 100644 --- a/content/operate/kubernetes/logs/collect-logs.md +++ b/content/operate/kubernetes/logs/collect-logs.md @@ -39,7 +39,7 @@ You can run `log_collector.py` with the following options: | `-n`, `--namespace` | Sets the namespace(s) to collect from. Can be set to a single namespace, or multiple namespaces (comma-separated). When left empty, will use the current context's namespace from kubeconfig. | | `-o`, `--output_dir` | Sets the output directory. Defaults to current working directory. | | `-a`, `--logs_from_all_pods` | Collect logs from all pods in the selected namespace(s), and otherwise collect only from the operator and pods run by the operator. | -| `-t`, `--timeout` | Time to wait for external commands to finish execution (Linux only). Default to 180s. Specify 0 to disable timeout. | +| `-t`, `--timeout` | Time to wait for external commands to finish execution (Linux only). Defaults to 180s. Specify 0 to disable timeout. | | `--k8s_cli` | The K8s cli client to use (kubectl/oc/auto-detect). Defaults to auto-detect (chooses between 'kubectl' and 'oc'). Full paths can also be used. | | `-m`, `--mode` | Controls which resources are collected. In 'restricted' mode, only resources associated with the operator and have the label 'app=redis-enterprise' are collected. In 'all' mode, all resources are collected. Defaults to 'restricted' mode. | | `--collect_istio` | Collect data from istio-system namespace to debug potential problems related to istio ingress method. |