Bartosz Bierkowski - Low dose cloud

OpenShift Morsels: rolling back the deployments

On day #24 we check again rolling back the deployment.

As it turns out, there is another command to rollback the deployment – next to oc rollout undo and it has similar parameters. You can make your deployment fail first as described in OpenShift Morsels: retrying deployments.

Rolling back to last working version is simpler than with undo.

As you can see the triggers are automatically disabled to prevent them from starting new deployment.

In similar way you can rollback to specific version of deployment.

Before running actual rollback it might be worth having a dry run to check how will the configuration exactly look like.

It is worth mentioning that the number of replicas will not change during rollback, but for example environment variables will be rolled back. So it is anyway required to check your deployment after rollback to make sure everything is up to date.

Environment

The commands were executed using minishift and the following client/server versions of OpenShift.

Client:
oc v3.7.0+7ed6862
client kubernetes v1.7.6+a08f5eeb62
Server:
openshift v3.6.0+c4dd4cf
server kubernetes v1.6.1+5115d708d7

Newsletter

Thanks for reading the OpenShift morsels. To get updates about new articles, you can sign up to the newsletter below.

As a thank you message, you will also get access to OpenShift CLI CheatSheet listing most commonly used commands together with a short explanation.

Did you like the article?
Join the newsletter to receive notifications about new articles.
I respect your privacy.