Skip to content

Commit 58dbc0f

Browse files
authored
Merge pull request #98147 from stevsmit/16016-osdocs
CQA for Viewing Pods
2 parents def4678 + ca47921 commit 58dbc0f

7 files changed

+91
-129
lines changed

modules/nodes-pods-about.adoc

Lines changed: 0 additions & 13 deletions
This file was deleted.

modules/nodes-pods-viewing-project.adoc

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,18 @@
66
[id="nodes-pods-viewing-project_{context}"]
77
= Viewing pods in a project
88

9-
You can view a list of pods associated with the current project, including the number of replica, the current status, number or restarts and the age of the pod.
9+
You can display pod usage statistics, such as CPU, memory, and storage consumption, to monitor container runtime environments and ensure efficient resource use.
1010

1111
.Procedure
1212

13-
To view the pods in a project:
14-
15-
. Change to the project:
13+
. Change to the project by entering the following command:
1614
+
1715
[source,terminal]
1816
----
19-
$ oc project <project-name>
17+
$ oc project <project_name>
2018
----
2119

22-
. Run the following command:
23-
+
24-
[source,terminal]
25-
----
26-
$ oc get pods
27-
----
28-
+
29-
For example:
20+
. Obtain a list of pods by entering the following command:
3021
+
3122
[source,terminal]
3223
----
@@ -40,8 +31,8 @@ NAME READY STATUS RESTARTS AGE
4031
console-698d866b78-bnshf 1/1 Running 2 165m
4132
console-698d866b78-m87pm 1/1 Running 2 165m
4233
----
43-
+
44-
Add the `-o wide` flags to view the pod IP address and the node where the pod is located.
34+
35+
. Optional: Add the `-o wide` flags to view the pod IP address and the node where the pod is located. For example:
4536
+
4637
[source,terminal]
4738
----

modules/nodes-pods-viewing-usage.adoc

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,15 @@ storage consumption.
1313
.Prerequisites
1414

1515
* You must have `cluster-reader` permission to view the usage statistics.
16-
1716
* Metrics must be installed to view the usage statistics.
1817
1918
.Procedure
2019

21-
To view the usage statistics:
22-
23-
. Run the following command:
24-
+
25-
[source,terminal]
26-
----
27-
$ oc adm top pods
28-
----
29-
+
30-
For example:
20+
. View the usage statistics by entering the following command:
3121
+
3222
[source,terminal]
3323
----
34-
$ oc adm top pods -n openshift-console
24+
$ oc adm top pods -n <namespace>
3525
----
3626
+
3727
.Example output
@@ -44,18 +34,9 @@ downloads-594fcccf94-bcxk8 3m 18Mi
4434
downloads-594fcccf94-kv4p6 2m 15Mi
4535
----
4636

47-
. Run the following command to view the usage statistics for pods with labels:
48-
+
49-
[source,terminal]
50-
----
51-
$ oc adm top pod --selector=''
52-
----
53-
+
54-
You must choose the selector (label query) to filter on. Supports `=`, `==`, and `!=`.
55-
+
56-
For example:
37+
. Optional: Add the `--selector=''` label to view usage statistics for pods with labels. Note that you must choose the label query to filter on, such as `=`, `==`, or `!=`. For example:
5738
+
5839
[source,terminal]
5940
----
60-
$ oc adm top pod --selector='name=my-pod'
41+
$ oc adm top pod --selector='<pod_name>'
6142
----

modules/viewing-resource-logs-cli-console.adoc

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -7,71 +7,4 @@
77
[id="viewing-resource-logs-cli-console_{context}"]
88
= Viewing resource logs
99

10-
You can view the log for various resources in the {oc-first} and web console. Logs read from the tail, or end, of the log.
11-
12-
.Prerequisites
13-
14-
* Access to the {oc-first}.
15-
16-
.Procedure (UI)
17-
18-
. In the {product-title} console, navigate to *Workloads* -> *Pods* or navigate to the pod through the resource you want to investigate.
19-
+
20-
[NOTE]
21-
====
22-
Some resources, such as builds, do not have pods to query directly. In such instances, you can locate the *Logs* link on the *Details* page for the resource.
23-
====
24-
25-
. Select a project from the drop-down menu.
26-
27-
. Click the name of the pod you want to investigate.
28-
29-
. Click *Logs*.
30-
31-
.Procedure (CLI)
32-
33-
** View the log for a specific pod:
34-
+
35-
[source,terminal]
36-
----
37-
$ oc logs -f <pod_name> -c <container_name>
38-
----
39-
+
40-
--
41-
where:
42-
43-
`-f`:: Optional: Specifies that the output follows what is being written into the logs.
44-
`<pod_name>`:: Specifies the name of the pod.
45-
`<container_name>`:: Optional: Specifies the name of a container. When a pod has more than one container, you must specify the container name.
46-
--
47-
+
48-
For example:
49-
+
50-
[source,terminal]
51-
----
52-
$ oc logs ruby-58cd97df55-mww7r
53-
----
54-
+
55-
[source,terminal]
56-
----
57-
$ oc logs -f ruby-57f7f4855b-znl92 -c ruby
58-
----
59-
+
60-
The contents of log files are printed out.
61-
62-
** View the log for a specific resource:
63-
+
64-
[source,terminal]
65-
----
66-
$ oc logs <object_type>/<resource_name> <1>
67-
----
68-
<1> Specifies the resource type and name.
69-
+
70-
For example:
71-
+
72-
[source,terminal]
73-
----
74-
$ oc logs deployment/ruby
75-
----
76-
+
77-
The contents of log files are printed out.
10+
You can view logs for resources in the OpenShift CLI (oc) or web console. Logs display from the end (or tail) by default. Viewing logs for resources can help you troubleshoot issues and monitor resource behavior.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * observability/logging/log_visualization/log-visualization.adoc
4+
// * nodes/pods/nodes-pods-viewing.adoc
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="viewing-resource-logs-cli_{context}"]
8+
= Viewing resource logs by using the CLI
9+
10+
Use the following procedure to view resource logs by using the command-line interface (CLI).
11+
12+
.Prerequisites
13+
14+
* Access to the {oc-first}.
15+
16+
.Procedure
17+
18+
* View the log for a specific pod by entering the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc logs -f <pod_name> -c <container_name>
23+
----
24+
+
25+
--
26+
where:
27+
28+
`-f`:: Optional: Specifies that the output follows what is being written into the logs.
29+
`<pod_name>`:: Specifies the name of the pod.
30+
`<container_name>`:: Optional: Specifies the name of a container. When a pod has more than one container, you must specify the container name.
31+
--
32+
+
33+
For example:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc logs -f ruby-57f7f4855b-znl92 -c ruby
38+
----
39+
40+
* View the log for a specific resource by entering the following command:
41+
+
42+
[source,terminal]
43+
----
44+
$ oc logs <object_type>/<resource_name>
45+
----
46+
+
47+
For example:
48+
+
49+
[source,terminal]
50+
----
51+
$ oc logs deployment/ruby
52+
----
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * observability/logging/log_visualization/log-visualization.adoc
4+
// * nodes/pods/nodes-pods-viewing.adoc
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="viewing-resource-logs-console_{context}"]
8+
= Viewing resource logs by using the web console
9+
10+
Use the following procedure to view resource logs by using the {product-title} web console.
11+
12+
.Procedure
13+
14+
. In the {product-title} console, navigate to *Workloads* -> *Pods* or navigate to the pod through the resource you want to investigate.
15+
+
16+
[NOTE]
17+
====
18+
Some resources, such as builds, do not have pods to query directly. In such instances, you can locate the *Logs* link on the *Details* page for the resource.
19+
====
20+
21+
. Select a project from the drop-down menu.
22+
23+
. Click the name of the pod you want to investigate.
24+
25+
. Click *Logs*.

nodes/pods/nodes-pods-viewing.adoc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,12 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
As an administrator, you can view the pods in your cluster and to determine the health of those pods and the cluster as a whole.
10-
11-
include::modules/nodes-pods-about.adoc[leveloffset=+1]
12-
13-
// The following include statements pull in the module files that comprise
14-
// the assembly. Include any combination of concept, procedure, or reference
15-
// modules required to cover the user story. You can also include other
16-
// assemblies.
9+
As an administrator, you can view cluster pods, check their health, and evaluate the overall health of the cluster. You can also view a list of pods associated with a specific project or view usage statistics about pods. Regularly viewing pods can help you detect problems early, track resource usage, and ensure cluster stability.
1710

1811
include::modules/nodes-pods-viewing-project.adoc[leveloffset=+1]
1912

2013
include::modules/nodes-pods-viewing-usage.adoc[leveloffset=+1]
2114

2215
include::modules/viewing-resource-logs-cli-console.adoc[leveloffset=+1]
23-
24-
16+
include::modules/viewing-resource-logs-console.adoc[leveloffset=+2]
17+
include::modules/viewing-resource-logs-cli.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)