Reputation: 5364
We have an application running on bluemix, however whenever we deploy the application is stopped, the new version gets compiled/bundled and then started, all this leading to a downtime of at least 60s.
How can we deploy with no downtime?
Upvotes: 0
Views: 214
Reputation: 11502
There is a Cloud Foundry plugin for blue-green deployment. As well as the basic behaviour (zero downtime), it supports things like smoke tests. It lives at https://github.com/bluemixgaragelondon/cf-blue-green-deploy.
To use it, get the plugin from the CF Community Repository:
cf install-plugin blue-green-deploy -r CF-Community
Then deploy the app (the smoke test parameter is optional)
cd your_app_root
cf blue-green-deploy app_name --smoke-test <path to test script>
Upvotes: 0
Reputation: 1912
It's often called a blue-green deployment or red-black deployment. The basic idea is to deploy the new version of the app side-by-side with the old one, test that everything is working, then switch traffic over to the new one. The old app is kept as a backup (and it could eventually be stopped so it's not consuming memory or deleted).
Here is a non-Bluemix-specific description of the idea and also the Bluemix documentation for it.
Using the cf CLI it would look something like this:
$ cf push Blue
$ cf push Green
$ cf map-route Green mybluemix.net -n Blue
$ cf unmap-route Blue mybluemix.net -n Blue
$ cf unmap-route Green mybluemix.net -n Green
Upvotes: 2
Reputation: 17176
You can use rolling updates to avoid downtime. Sometimes they can also be found as "blue/green deployments". Basically, you keep the old version running until the newer is up. Then you switch over, either directly or after some time to see whether the new version is really stable. The technique can be combined with load balancing to decide how much traffic to route over.
I would recommend reading one of these:
Upvotes: 1