Useful OpenShift Commands¶
Log in:
Visit the web console
Select “Copy login command” from the account menu in the upper right
Paste the generated
oc login
command in to your terminaloc login --token=... --server=https://...
List the projects:
oc projects
Create a project:
oc new-project <project name> --description="<project description>"
Get current project:
oc project
Set current project:
oc project <project name>
List pods in current project:
oc get pods
describe a pod:
oc describe pod <pod name>
Show log from a pod:
oc logs <pod name>
Start a shell in a pod:
oc exec -it <pod name> -- bash