Over a million developers have joined DZone.
Platinum Partner

Blue-Green Deployment with CloudFoundry

· Cloud Zone

The Cloud Zone is brought to you in partnership with Iron.io. Discover how Microservices have transformed the way developers are building and deploying applications in the era of modern cloud infrastructure.

Martin Fowler Describes Blue-Green Deployment

Pivotal CF Blue-Green Deployment Documentation

Matt Stine’s NFJS Article on B-G

A simple example:

cf push Blue-tspann -n demo-time-tspann -i 1
cf push Green-tspann -n demo-time-temp-tspann -i 1
cf map-route Green-tspann cfapps.io -n demo-time-tspann
cf unmap-route Blue-tspann cfapps.io -n demo-time-tspann
cf delete-route cfapps.io -n demo-time-temp-tspann
cf routes
cf delete Blue-tspann

First we push our original version of the application, then a second version of the application.   You are either releasing a new version or doing an A/B version.   Jenkins can automate this deploy.

Now we have two versions of the application running in two identical environments.

We map the Green application to the original route (demo-time-tspann).   Now all requests are load balanced between the Blue and Green applications.

Now unmap the Blue application so no traffic will be routed there.   Now all traffic goes to the new Green version.  You can keep the Blue version deployed as a fail safe or delete it.

The Cloud Zone is brought to you in partnership with Iron.io. Learn how to build and test their Go programs inside Docker containers.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}