Bartosz Bierkowski - Low dose cloud

OpenShift Morsels: retrying deployments

On day #22 retrying the deployment and going back to previous version.

The retry  subcommand allows starting again a failed deployment. How to test it? I think the simplest possible way is to set the memory request for the pod to couple hundred Gi in your Deployment Config.

In the containers.resources  section the requested memory can be set and OpenShift will schedule the pod only when it finds a node that has at least the specified amount of memory.

After waiting 10 minutes the deployment fails and you can retry it. The old version of the application is started automatically.

In this case it will obviously fail again, since the amount of memory didn’t change. If the application deployment was failing due to a different reason – like broken or unreachable external service, retrying the deployment might just work.

Next of the subcommands – undo – gives you possibility to go back to previous working version of the application. It works just like deploying new version – a new Replication Controller is created, but with old configuration.

You can also specify which of previous version you would like to deploy.

Again a new Replication Controller is added, but based on manually selected version.

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.