Basic commands
How to Monitor Pods
Using the OpenShift Console:
Navigate to Observe > Dashboards or Metrics.
CLI Method:
View pods:
How to Start a Debug Container
Using the OpenShift Console
-
Access the OpenShift Console: Navigate to Workloads > Pods.
-
Select the Pod: Click on the pod you want to debug.
-
Open Debug Terminal: Use the "Terminal" tab in the GUI to execute commands directly in the container.
Alternatively, use the Actions > Debug option (if available), which starts a debug container or pod.
Go to the logs tab, and if your pods fails to start you will see adebugoption.
CLI Method
-
Start a debug session on a pod:
This starts a debug pod based on the existing pod's configuration. -
Start a debug session with a specific image:
Example: - Attach to a container:
After starting the debug pod, use
oc rshoroc execto interact with the debug container.
How to connect to a pod using ssh
CLI Method
Using oc rsh
1. Start an interactive shell in a pod:
Using oc exec
-
Run a command in a pod:
Example: -
Start a bash shell:
If the container doesn't have bash, try/bin/sh:
Troubleshooting Access
- If the pod has multiple containers, specify the container name:
Check the
oc get podsoutput to confirm the pod name and container name.
How to debug network issues
CLI Method
Use the netshoot image from quay.io: