mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
53 lines
1.3 KiB
Plaintext
53 lines
1.3 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * edge_computing/day_2_core_cnf_clusters/troubleshooting/troubleshooting-general-troubleshooting.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="troubleshooting-general-debug-pod_{context}"]
|
|
= Debugging a pod
|
|
|
|
In certain cases, you do not want to directly interact with your pod that is in production.
|
|
|
|
To avoid interfering with running traffic, you can use a secondary pod that is a copy of your original pod.
|
|
The secondary pod uses the same components as that of the original pod but does not have running traffic.
|
|
|
|
.Procedure
|
|
|
|
. List the pods by running the following command:
|
|
+
|
|
--
|
|
[source,terminal]
|
|
----
|
|
$ oc get pod
|
|
----
|
|
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAME READY STATUS RESTARTS AGE
|
|
busybox-1 1/1 Running 168 (34m ago) 7d
|
|
busybox-2 1/1 Running 119 (9m20s ago) 4d23h
|
|
busybox-3 1/1 Running 168 (43m ago) 7d
|
|
busybox-4 1/1 Running 168 (43m ago) 7d
|
|
----
|
|
--
|
|
|
|
. Debug a pod by running the following command:
|
|
+
|
|
--
|
|
[source,terminal]
|
|
----
|
|
$ oc debug -n <namespace> busybox-1
|
|
----
|
|
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
Starting pod/busybox-1-debug, command was: sleep 3600
|
|
Pod IP: 10.133.2.11
|
|
----
|
|
|
|
If you do not see a shell prompt, press Enter.
|
|
--
|
|
|
|
For more information, see "oc debug" and "Starting debug pods with root access". |