Skip to content

Commit 5a18204

Browse files
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
1 parent 5d74ac8 commit 5a18204

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

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

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,37 @@ As of version 6.2.18-3, the log collector tool has two modes:
2424

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

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

3231
```bash
33-
python log_collector.py
32+
python log_collector.py
3433
```
3534

36-
{{< note >}} If you get an error because the yaml module is not found, install the pyYAML module with `pip install pyyaml`.
37-
{{< /note >}}
35+
## Options
36+
37+
You can run `log_collector.py` with the following options:
3838

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

0 commit comments

Comments
 (0)