Skip to content

Commit ff42138

Browse files
K8s: Add log collector options (#1873)
* 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 * Apply suggestions from code review * remove 6.2.18 mention * Update content/operate/kubernetes/logs/collect-logs.md Co-authored-by: David Dougherty <[email protected]> --------- Co-authored-by: David Dougherty <[email protected]>
1 parent 8ee1637 commit ff42138

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

content/operate/kubernetes/logs/collect-logs.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ weight: 89
1313

1414
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.
1515

16-
As of version 6.2.18-3, the log collector tool has two modes:
16+
The log collector tool has two modes:
1717

1818
- **restricted** collects only resources and logs created by the operator and Redis Enterprise deployments
19-
- This is the default for versions 6.2.18-3 and later
2019
- **all** collects everything from your environment
21-
- This is the default mode for versions 6.2.12-1 and earlier
2220

2321
{{<note>}} This script requires Python 3.6 or later. {{</note>}}
2422

@@ -30,16 +28,35 @@ Before running the log collector, ensure you have the appropriate RBAC permissio
3028

3129
1. Download the latest [`log_collector.py`](https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/log_collector/log_collector.py) file.
3230

31+
1. Ensure your `kubectl` or `oc` CLI is configured to access the Kubernetes cluster you want to collect logs from.
32+
3333
1. Have a K8s administrator run the script on the system that runs your `kubectl` or `oc` commands.
34-
- Pass `-n` parameter to run on a different namespace than the one you are currently on
35-
- Pass `-m` parameter to change the log collector mode (`all` or `restricted`)
36-
- Run with `-h` to see more options
3734

3835
```bash
39-
python log_collector.py
36+
python log_collector.py
4037
```
4138

42-
{{< note >}} If you get an error because the yaml module is not found, install the pyYAML module with `pip install pyyaml`.
43-
{{< /note >}}
39+
## Options
40+
41+
You can run `log_collector.py` with the following options:
42+
43+
| Option | Description |
44+
|--------|-------------|
45+
| `-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. |
46+
| `-o`, `--output_dir` | Sets the output directory. Defaults to current working directory. |
47+
| `-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. |
48+
| `-t`, `--timeout` | Time to wait for external commands to finish execution (Linux only). Defaults to 180s. Specify 0 to disable timeout. |
49+
| `--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. |
50+
| `-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. |
51+
| `--collect_istio` | Collect data from istio-system namespace to debug potential problems related to istio ingress method. |
52+
| `--collect_empty_files` | Collect empty log files for missing resources. |
53+
| `--helm_release_name` | Collect resources related to the given Helm release name. |
54+
| `--collect_rbac_resources` | Temporary development flag. Collect all role based access control related custom resources. |
55+
| `-h`, `--help` | Show help message and exit. |
56+
57+
{{< note >}} If you get an error because the yaml module is not found, install the pyYAML module with `pip install pyyaml`.
58+
{{< /note >}}
4459
4560
1. Upload the resulting `tar.gz` file containing all the logs to [Redis Support](https://support.redislabs.com/).
61+
62+

0 commit comments

Comments
 (0)