You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| <nobr>`-duration`, `-d`</nobr> |`time.Duration` Sets the time duration to capture logs of consul cluster. (e.g., '5m' for the logs of next 5 minutes). <br/> Minimum time duration should be atleast 10s. |`5m0s`|
294
+
| <nobr>`-since`, `-s`</nobr> |`time.Duration` Sets the time duration from which to start capturing logs from consul cluster. (e.g., '5m' for the logs of last 5 minutes). <br/> Minimum time duration should be atleast 10s. | none |
295
+
| <nobr>`-capture`, `-c`</nobr> |`String` Specifies the components to capture. Supported values are: all, helm, crds, sidecar, pods, proxy. See [Capture Targets](#capture-targets) for more. <br/> You can also specify a comma-delineated list to capture components (capture targets). <br/> e.g., `consul-k8s debug -capture helm,crds` or `consul-k8s debug -capture helm -capture crds`| all |
296
+
| <nobr>`-output`, `-o`</nobr> |`String` Sets the full path of where to write the directory of collected data and resulting archive. <br/> Defaults to current working directory and default filename will be consul-k8s-debug-'current-timestamp' | current working directory |
297
+
| <nobr>`-archive`, `-a`</nobr> |`Boolean` Enables you to archive the output debug directory into a compressed tar `.tar.gz` file. |`true`|
298
+
| <nobr>`-namespace`, `-n`</nobr> |`String` Specifies the namespace of the Consul installed components and resources. |`consul`|
| <nobr>`helm`</nobr> | Captures the Helm release, which is an instance of a Helm chart running in your Kubernetes cluster. |
316
+
| <nobr>`crds`</nobr> | Captures both HashiCorp-specific and external CRDs installed by Consul, and list the applied resources for each CRD (e.g., servicerouters, apigateways). <br/> If multiple errors occured, they are captured in a single file. |
317
+
| <nobr>`sidecar`</nobr> | Captures list of all pods across namespaces that have been injected with Consul sidecars using the label consul.hashicorp.com/connect-inject-status=injected. |
318
+
| <nobr>`pods`</nobr> | Captures logs from key Consul components: consul-server, consul-client, connect-injector & gateways. <br/> Captures 'log capture status' in an audit file. <br/> If multiple errors occured, they are captured in a single file. |
319
+
| <nobr>`proxy`</nobr> | Captures envoy admin endpoint data (/stats, /clusters, /listeners, /config_dump) for all proxies within cluster. <br/> If multiple errors occured, they are captured in a single file. |
320
+
| <nobr>`all`</nobr> | Captures all of the above targets. |
321
+
322
+
323
+
#### Sample Debug command
324
+
325
+
Below command will capture everything for 10s and write the debug bundle in `debugfile`.
326
+
Please Note: `-output``debugfile` is not a complete path, so command will write all data in current working dir `cwd/debugfile`.
Since the debug command collects data from across the cluster, it can be very big archive. So, we've organized the debug bundle and its data using the following patterns
351
+
to help users navigate, read, and share different files more effectively.
352
+
Please note that file structure pattern are for logs and proxy target capture as they interact will multiple pods.
--> Please re-run the debug command for complete capture
441
+
```
442
+
443
+
#### Example Commands
444
+
445
+
Below command collects every component data and logs for next 5 miunutes and writes the debug archive in current working directory with foldername as consul-k8s-debug-currentTimestamp.
446
+
```shell-session
447
+
$ consul-k8s debug
448
+
```
449
+
450
+
Below command collects every component data and logs for next 10 minutes and writes the debug archive in current working directory with foldername as consul-k8s-debug-currentTimestamp.
451
+
```shell-session
452
+
$ consul-k8s debug -duration 10m
453
+
```
454
+
455
+
Below command collects every component data and logs of past 10 minutes and writes the debug archive in current working directory with foldername as consul-k8s-debug-currentTimestamp.
456
+
```shell-session
457
+
$ consul-k8s debug -since 10m
458
+
```
459
+
460
+
Below command collects only helm data and logs for next 5 minutes and writes the debug archive in current working directory with foldername as consul-k8s-debug-currentTimestamp.
461
+
```shell-session
462
+
$ consul-k8s debug -capture helm, logs
463
+
```
464
+
465
+
Below command collects only helm data and logs for next 10 minutes and and writes the debug archive in current working directory with foldername as debugfile
Below command collects every component data and logs for next 5 miunutes and writes the debug directory (not archive) in current working directory with foldername as consul-k8s-debug-currentTimestamp
476
+
```shell-session
477
+
$ consul-k8s debug -archive=false
478
+
```
479
+
280
480
### `install`
281
481
282
482
The `install` command installs Consul on your Kubernetes cluster.
0 commit comments