You can review running pods dynamically by opening a shell inside a pod or by gaining network access through port forwarding.
-
You have access to the cluster as a user with the
cluster-adminrole. -
Your API service is still functional.
-
You have installed the OpenShift CLI (
oc).
-
Switch into the project that contains the pod you would like to access. This is necessary because the
oc rshcommand does not accept the-nnamespace option:$ oc project <namespace> -
Start a remote shell into a pod:
$ oc rsh <pod_name>where:
<pod_name>-
If a pod has multiple containers,
oc rshdefaults to the first container unless-c <container_name>is specified.
-
Start a remote shell into a specific container within a pod:
$ oc rsh -c <container_name> pod/<pod_name> -
Create a port forwarding session to a port on a pod:
$ oc port-forward <pod_name> <host_port>:<pod_port>where:
<pod_name> <host_port>:<pod_port>-
Enter
Ctrl+Cto cancel the port forwarding session.