Skip to content

Commit 99fbeb9

Browse files
authored
Merge pull request #99406 from DCChadwick/osdocws154444
OSDOCS-15444 Adding module on how to exclude pod logs from OC Admin In…
2 parents 0e703bc + 301672c commit 99fbeb9

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * support/gathering-cluster-data.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="support-must-gather-targeted-collection-gathering-data_{context}"]
7+
= Gathering data for specific resources
8+
9+
Instead of collecting data for the entire cluster, you can direct the `must-gather` tool to inspect a specific resource. This method is highly effective for isolating issues within a single project, Operator, or application.
10+
11+
The `must-gather` tool uses `oc adm inspect` internally. You can specify what to inspect by passing the `inspect` command and its arguments after the `--` separator.
12+
13+
.Procedure
14+
15+
* To gather data for a specific namespace, such as `my-project`, run the following command:
16+
+
17+
[source,terminal]
18+
----
19+
$ oc adm must-gather --dest-dir=my-project-must-gather -- oc adm inspect ns/my-project
20+
----
21+
22+
* This command collects all standard resources within the `my-project` namespace, including logs from pods in that namespace, but excludes cluster-scoped resources.
23+
24+
* To gather data related to a specific Cluster Operator, such as `openshift-apiserver`, run the following command:
25+
+
26+
[source,terminal]
27+
----
28+
$ oc adm must-gather --dest-dir=apiserver-must-gather -- oc adm inspect clusteroperator/openshift-apiserver
29+
----
30+
31+
* To exclude logs entirely and significantly reduce the size of the `must-gather` archive, add a double dash (`--`) after `oc adm must-gather` command and add the `--no-logs` argument:
32+
+
33+
[source,terminal]
34+
----
35+
$ oc adm must-gather -- /usr/bin/gather --no-logs
36+
----
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * support/gathering-cluster-data.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="support-must-gather-targeted-collection_{context}"]
7+
= Reducing the size of must-gather output
8+
9+
The `oc adm must-gather` command collects comprehensive cluster information. However, a full data collection can result in a large file that is difficult to upload and analyze and could result in timeouts.
10+
11+
To manage the output size and target your data collection for more effective troubleshooting, you can pass specific flags to the underlying `gather` script or scope the collection to particular resources.

support/gathering-cluster-data.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ ifndef::openshift-origin[]
3131
include::modules/support-gather-data.adoc[leveloffset=+2]
3232
endif::openshift-origin[]
3333

34+
ifndef::openshift-origin[]
35+
// Reducing the size of must-gather output
36+
include::modules/support-must-gather-targeted-collection.adoc[leveloffset=+1]
37+
endif::openshift-origin[]
38+
39+
ifndef::openshift-origin[]
40+
// Gathering data for specific resources
41+
include::modules/support-must-gather-targeted-collection-gathering-data.adoc[leveloffset=+2]
42+
endif::openshift-origin[]
43+
3444
ifndef::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
3545
[role="_additional-resources"]
3646
.Additional resources

0 commit comments

Comments
 (0)