13. Blue Green JVM
• For zero down-time in production
• Route = host + shared_domain
• We can have many routes point to same application
• Blue Gree JVM
• deploy application in PR with a non production route. One prefixed green
and one prefixed blue
• Create the production route manually: without mapping to any jvm
• Which ever instance is tested, point the PR_ROUTE to that jvm instance
Rajan p Upadhyay 13
14. Blue green jvm example
• Say in PR, an application ABC needs to be deployed with a route abc.
rajanu.com.np
Where shared-domain=rajanu.com.np and host=abc
• Deploy the application with a host green-abc and app-name green-abc
ie route = green-abc.rajanu.com.np
• Create the abc route manually
cf creae-route <SPACE> rajanu.com.np –n abc
• When testing is finished with the application and it ok, map the route
cf map-route ABC rajanu.com.np –n abc
• Now route abc. rajanu.com.np will also point to the application ABC in
addition to green-abc.rajanu.com.np
• you can unmap the green-abc route from the application
Rajan p Upadhyay 14
15. Blue green jvm example continued
• Next time you have some change in code and want to deploy in PR
• Deploy it with host blue-abc with a new applicationName blue-abc.
• So the new instance will have a mapped route of blue-abc.rajanu.com.np
• Lets say the testing is complete and you want to make this the production
version. You can map the abc route to blue-abc application.
Cf map-route blue-abc rajanu.com.np –n abc
• Now the route abc. rajanu.com.np will be pointing to both the instances green-
abc and blue-abc
• Now unmap the route from the green-abc instance so that it will only point to
blue-abc instance
• Cf unmap-route green-abc rajanu.com.np –n abc
• If some problem is discovered and you want to backout the changes, simply map
the route to green-abc and unmap it from blue-abc.
Rajan p Upadhyay 15