oc Scale Examples¶
Introduction¶
Scaling changes the number of replicas for a workload. In OpenShift, check the Deployment, ReplicaSet, and pods so you know whether the scheduler actually placed the requested replicas.
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 scale deployment/web --replicas=3 -n app
oc rollout status deployment/web -n app
oc get pods -n app -l app=web
oc get deployment web -n app
Example output:
deployment.apps/web scaled
NAME READY UP-TO-DATE AVAILABLE AGE
web 3/3 3 3 12m
Verification¶
oc get deployment web -n app
oc get pods -n app -l app=web -o wide
oc describe deployment web -n app
Common Mistakes¶
- Scaling pods without checking node capacity.
- Scaling manually while HPA is also controlling replicas.
- Assuming replicas are available just because they were requested.
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 Scale Examples is most useful when paired with verification. Check the project, run the command against the intended object, and confirm the resulting OpenShift state.