Skip to content

Commit dc67e12

Browse files
committed
updated formatting
1 parent a837f86 commit dc67e12

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

content/consul/v1.22.x/content/docs/reference/cli/consul-k8s.mdx

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -288,35 +288,36 @@ $ consul-k8s debug <OPTIONS>
288288

289289
The following Command options are available.
290290

291-
| Flag | Description | Default |
292-
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------|
293-
| <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` |
291+
| Flag | Description | Default |
292+
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------|
293+
| <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'` | `currentWorkingDirectory/ consul-k8s-debug-current-timestamp`|
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` |
299299

300300
The following Global options are available.
301301

302302
| Flag | Description | Default |
303303
| ----------------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------- |
304304
| <nobr>`-kubeconfig`</nobr> | `String` Sets the Kubernetes context to use for Consul K8s CLI operations. | none |
305305
| <nobr>`-kubecontext`</nobr> | `String` Specifies the path to the kubeconfig file. | none |
306+
Note: Aliases are not available for the `debug` command global options.
306307

307308

308309
#### Capture Targets
309310

310-
The -capture flag can be specified multiple times to capture specific components when debug is running.
311-
Supported values are: all, helm, crds, sidecar, pods, proxy. By default, it captures all components.
311+
The `-capture` flag can be specified multiple times to capture specific components before running debug command.
312+
Supported values are: `all`, `helm`, `crds`, `sidecar`, `pods`, `proxy`. By default, it captures `all` components.
312313

313314
| Capture Targets | Description |
314315
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
315316
| <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. |
317+
| <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 error file. |
318+
| <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`. |
319+
| <nobr>`pods`</nobr> | Captures logs from key Consul component pods: 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 error file. |
320+
| <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 error file. |
320321
| <nobr>`all`</nobr> | Captures all of the above targets. |
321322

322323

@@ -347,24 +348,25 @@ Saved debug directory: debugfile
347348

348349
#### Understanding debug Archive/Directory structure
349350

350-
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+
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
351352
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.
353+
Please note that file structure pattern are only for `logs` and `proxy` target capture as they interact will multiple pods in a cluster.
353354

354355
| Capture Targets | File structure patterns and naming conventions. |
355356
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
356357
| <nobr>`helm`</nobr> | `debugfile/helm-config.json` |
357358
| <nobr>`crds`</nobr> | `debugfile/CRDsResources.json` <br/> `debugfile/CRDsResourcesErrors.txt` |
358359
| <nobr>`sidecar`</nobr> | `debugfile/sidecar-pods.json` |
359360
| <nobr>`pods`</nobr> | pattern: `debugfile/logs/<componentType>/<componentName>/<podName>/<containerName.log>`, <br/> e.g., `debugfile/logs/statefulsets/consul-server/consul-server-0/consul.log` <br/><br/>`debugfile/logCaptureAudit.txt` <br/> `debugfile/logCaptureErrors.txt` |
360-
| <nobr>`proxy`</nobr> | pattern: `debugfile/proxy/<namespace>/<proxyType>/<proxyPod>/*`, <br/><br/>`debugfile/proxyList.json` <br/>`debugfile/proxy/proxyCaptureErrors.txt` |
361+
| <nobr>`proxy`</nobr> | pattern: `debugfile/proxy/<namespace>/<proxyType>/<proxyPod>/*`, <br/> e.g., `debugfile/proxy/consul-ns/sidecar/app-sidecar/config_dumps.json` <br/> `debugfile/proxy/consul-ns/sidecar/app-sidecar/config.json`<br/> `debugfile/proxy/consul-ns/sidecar/app-sidecar/stats.json` <br/><br/>`debugfile/proxyList.json` <br/>`debugfile/proxy/proxyCaptureErrors.txt` |
361362

362363

363364
#### High-level overview of the directory structure within the debug bundle
364365

365366
```shell-session
366367
$ consul-k8s debug -output debugfile -d 10s archive=false
367-
.... [ignore terminal output]
368+
.... [ignore terminal outpu]
369+
.... [assuming no error occured (so no error files)]
368370
$ tree ./debugfile
369371
.
370372
├── CRDsResources.json
@@ -423,7 +425,7 @@ $ tree ./debugfile
423425
#### Signal Interrupt
424426

425427
<Note>
426-
If the debug run is interrupted, all collected data—including any partial captureswill be cleaned up.
428+
If the debug run is interrupted, all collected data —including any partial captures, will be cleaned up.
427429
Please re-run the command to collect all data, or use the `-capture` flag to specify which data to collect.
428430
</Note>
429431

@@ -457,19 +459,19 @@ Below command collects every component data and logs of past 10 minutes and writ
457459
$ consul-k8s debug -since 10m
458460
```
459461

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.
462+
Below command collects only helm config and logs for next 5 minutes and writes the debug archive in current working directory with foldername as consul-k8s-debug-currentTimestamp.
461463
```shell-session
462464
$ consul-k8s debug -capture helm, logs
463465
```
464466

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
467+
Below command collects only helm config and logs for next 5 minutes and and writes the debug archive in current working directory with foldername as debugfile
466468
```shell-session
467469
$ consul-k8s debug -capture helm, logs -output debugfile
468470
```
469471

470-
Below command collects only helm data and logs for next 10 minutes and and writes the debug archive at the given path with foldername as debugfile
472+
Below command collects only helm config and logs for next 10 minutes and and writes the debug archive at the given path with foldername (below folder name is debugfile).
471473
```shell-session
472-
$ consul-k8s debug -capture helm, logs -output ~/user/dev/desktop/consul/debugfile
474+
$ consul-k8s debug -duration 10m -capture helm, logs -output ~/user/dev/desktop/consul/debugfile
473475
```
474476

475477
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

0 commit comments

Comments
 (0)