How can you roll back a failed deployment in OpenShift?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

How can you roll back a failed deployment in OpenShift?

Explanation:
Rolling back a failed deployment in OpenShift is done by using the rollout history and undoing the current rollout to a previous working revision. OpenShift tracks each deployment as a revision and can switch the deployment configuration and image back to what it was in the prior revision, recreating the pods with that known-good state. The best approach is to run the undo command for the deployment, which automatically reverts to the previous revision. If you need to target a specific older revision, you can first inspect the rollout history to find the desired revision, then use undo with that revision. This method is preferred because it leverages the built-in rollout history, preserves the previous working configuration, and minimizes downtime. Other options—deleting and recreating, rebuilding and redeploying, or scaling to zero and recreating—do not efficiently revert to a known-good state and can introduce unnecessary downtime or configuration drift.

Rolling back a failed deployment in OpenShift is done by using the rollout history and undoing the current rollout to a previous working revision. OpenShift tracks each deployment as a revision and can switch the deployment configuration and image back to what it was in the prior revision, recreating the pods with that known-good state.

The best approach is to run the undo command for the deployment, which automatically reverts to the previous revision. If you need to target a specific older revision, you can first inspect the rollout history to find the desired revision, then use undo with that revision.

This method is preferred because it leverages the built-in rollout history, preserves the previous working configuration, and minimizes downtime. Other options—deleting and recreating, rebuilding and redeploying, or scaling to zero and recreating—do not efficiently revert to a known-good state and can introduce unnecessary downtime or configuration drift.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy