oc New Project Explained¶
Introduction¶
oc new-project creates an OpenShift project and switches your current context to it. Admins often pair it with quotas, limits, and role bindings before handing it to a team.
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 new-project app-dev
oc project
oc get project app-dev
oc adm policy add-role-to-user edit developer -n app-dev
Example output:
Now using project "app-dev" on server "https://api.ocp.example.com:6443".
Verification¶
oc get project app-dev
oc describe project app-dev
oc auth can-i create pods -n app-dev
Common Mistakes¶
- Creating projects without quotas in shared clusters.
- Granting admin when edit is enough.
- Forgetting to switch back to the previous project.
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 New Project Explained is most useful when paired with verification. Check the project, run the command against the intended object, and confirm the resulting OpenShift state.