Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Blue-Green Deployment with CloudFoundry

DZone's Guide to

Blue-Green Deployment with CloudFoundry

· Cloud Zone
Free Resource

Site24x7 - Full stack It Infrastructure Monitoring from the cloud. Sign up for free trial.

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.


Site24x7 - Full stack It Infrastructure Monitoring from the cloud. Sign up for free trial.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}