Reputation: 5241
I have Java Liberty Web Application on Bluemix. If I need to update it, the app becomes unavailable for a few minutes. Is it possible to update it without turning it off? For example deploy two applications and reroute to a second one one when first is being updated?
Upvotes: 4
Views: 112
Reputation: 11502
This is known as a blue-green deployment, and there are several cloud foundry plugins which will do it 'automatically':
Bluemix's Active Deploy service
This is new function, so it's in beta at the moment. To make the service available, you can add it from the Bluemix service catalog to your space. If you're running cf locally, you'll need to install the plugin:
cf add-plugin-repo bluemix http://plugins.ng.bluemix.net/
cf install-plugin active-deploy -r bluemix
Once it's available (either with a cf plugin install, or the catalog configuration), and you have routes, you can do
cf push --no-route new-version
cf active-deploy-create old-version new-version
Cloud Foundry community-contributed plugin for blue green deployments
You can install this using cf add-plugin-repo garage https://garage-cf-plugins.eu-gb.mybluemix.net/ cf install-plugin blue-green-deploy -r garage
Then, to push,
cf blue-green-deploy app_name --smoke-test <path to test script>
The smoke test part is optional, but a good idea.
Upvotes: 2
Reputation: 971
Yep. There best way of doing this currently is via the following steps.
cf map-route APP_NAME DOMAIN [-n HOSTNAME]
. Original application now has myroute.mybluemix.net and the changed application now has myroute.mybluemix.net & myroute2.mybluemix.net. At this point traffic will be routed equally between the two application versions (assuming they have the same number of instances).cf unmap-route APP_NAME DOMAIN [-n HOSTNAME]
. All traffic on myroute.mybluemix.net will now all be routed to the newer version.cf delete APP_NAME
cf unmap-route APP_NAME DOMAIN [-n HOSTNAME]
This seems a bit long winded but it will achieve what you want.
Upvotes: 6