oc Rollout Examples¶
Introduction¶
Rollout commands restart, monitor, and inspect workload updates. Use them after image, environment, probe, or resource changes to confirm that new pods are healthy.
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 rollout restart deployment/web -n app
oc rollout status deployment/web -n app
oc rollout history deployment/web -n app
oc get replicasets -n app -l app=web
Example output:
deployment.apps/web restarted
deployment "web" successfully rolled out
Verification¶
oc rollout status deployment/web -n app
oc get pods -n app -l app=web
oc describe deployment web -n app
Common Mistakes¶
- Restarting a deployment to hide a failing probe or bad image.
- Ignoring rollout timeout messages.
- Deleting ReplicaSets manually during rollout troubleshooting.
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 Rollout Examples is most useful when paired with verification. Check the project, run the command against the intended object, and confirm the resulting OpenShift state.