Application Deployment Strategies
There are number of strategies deploy application in to production environment. Today we are going to test all these different strategies in OpenShift platform.(I am using mini version of OpenShift called MiniShift in my mac)
Pre-Requisites for the following test,
1. Install MiniShift
brew cask install minishift
2. After the successful installation, start OpenShift locally
minishift start --vm-driver virtualbox
Once minishift started successfully, you will see similar details in your console,
Note: The IP is dynamically generated for each OpenShift cluster. To check the IP, run the minishift ipcommand.
The server is accessible via web console at:
https://192.168.99.100:8443/console
You are logged in as:
User: developer
Password: developer
To login as administrator:
oc login -u system:admin
Here we are going to discuss the following options
Blue/Green
Blue/Green deployment is a technique that reduces downtime and risk by running two identical production environments called Blue and Green. At any time, only one of the environments is live, with the live environment serving all production traffic.
To test Blue/Green deployment login to the above URL with developer account
-
Click on the Nginx icon
-
Click Next fill all the details for project (Below screen will when you click advanced) Git URL - https://github.com/nbenjamin/deployment-examples.git Branch - Blue
-
Click on
Continue to the project overview
-
Now click on the url from right side.
The page will display text in blue:
So Now we running version, its time to update the applicaiton with newer version
-
Repeat the step number 1
-
Click Next fill all the details for project (Below screen will when you click advanced) Git URL - https://github.com/nbenjamin/deployment-examples.git Branch - Green
-
Contiue the step till we get the deployed URL and you should see something like this New-URL
Once testing is over, its time to switch over to the new version
-
To enable the routing, click
Application menu-> rounter
and selectbluegreendeploy
application -
Now click on Edit from Action
-
Select the right service and Save.
- Now Old URL will have the latest (Green) changes
URL
Canary
Canary deployments are a pattern for rolling out releases to a subset of users or servers. The idea is to first deploy the change to a small subset of servers, test it, and then roll the change out to the rest of the servers.
If you are already in Applicaiton->Router page, then select
Split traffic across multiple services
on the Alternate Services
and this allow you to select the service which you need.
In the above configuration, selected 50% weight, so in this case, first request goes to blue
page and the second request goes to green
A/B Testing
A/B testing is suitable for frontend applications that are introducing new features or user interface changes. Its very important to hear feedback users, thus doing it directly in production is the best test environment you can have. The users’ reaction can show whether changes you have done are intuitive or not, and you can eventually adapt your changes according to the feedback.
OpenShift’s perspective, this is literally the same as canary deployment, except that you set the weights between the two services to 50% each