oc Adm Command Explained¶
Introduction¶
OpenShift command workflows should start with status, then narrow to the failing object, namespace events, and logs. This avoids jumping between unrelated resources.
When You Need This Command¶
Use this command when you need to inspect, change, or verify OpenShift resources from the terminal without relying on the web console.
Syntax¶
oc <command> <resource> [name] -n <project>
Practical Examples¶
oc status -n app
oc get events -n app --sort-by=.lastTimestamp
oc logs deployment/web -n app --tail=100
oc describe deployment web -n app
Example output:
In project app on server https://api.ocp.example.com:6443
svc/web - 172.30.21.144:8080
deployment/web deploys image-registry.openshift-image-registry.svc:5000/app/web:latest
Verification¶
oc status -n app
oc get all -n app
oc get events -n app --sort-by=.lastTimestamp
Common Mistakes¶
- Looking only at the final error and ignoring events.
- Checking the wrong project with oc.
- Changing several objects at once before confirming the current state.
Production Notes¶
Run read-only commands first, check the active project, and prefer declarative manifests for repeatable changes.
Quick Checklist¶
- Confirm the active project.
- Inspect the exact object named in the error.
- Read recent events.
- Apply one focused fix.
- Verify status after the change.
Related Guides¶
Summary¶
oc Adm Command Explained is most useful when paired with verification. Check the project, run the command against the intended object, and confirm the resulting OpenShift state.