Blue Green Deployment Strategy | Introduction + Demo with Azure Traffic Manager

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video we're going to understand what blue green deployments are after that we are going to see how you can implement blue green deployment practically on azure blue green deployment is a way to introduce new features or versions of your software without breaking your production environment this is a shift by exposing the new version of your software to a minimal set of uses and gradually increasing the user base that uses the new version of your software if at any point something breaks you have the control to go back to the old version of your software usually the deployment looks something like this you have two environments production and staging you want some of your users to access the old version of your software and a minimal set of users to access this staging environment here i have defined percentages 50 and 50 but this doesn't have to be that there should be a way for you to control this percentage one of the ways in which you can control this is using azure traffic manager you can add an azure traffic manager profile in front of your deployment so that all of your users are accessing the traffic manager endpoint to get the environment traffic manager is a dns based load balancer meaning that when users query for your website let's say example.com as your traffic manager will decide which users should go to which environment and there are few options for you to select when it comes to the routing methods such as weighted geographic and priority and few more with these methods you can define which users goes to which environment and you can achieve blue-green deployments with weighted routing method and which decides the probability of a user getting directed to a environment also one other thing that you should keep in your mind is that your traffic does not go through as your traffic manager it just directs the users to an environment after that the users are accessing the environment directly now hopefully we have a good understanding on what blue green deployments are and also we know a technology that we can use to implement blue green deployment on azure that is traffic manager let's go ahead and do a practical demo on how you can implement this on azure here i have a script that will deploy two environments the production environment and the staging environment this is similar to the diagram that i've shown i'm deploying here two resource groups in each of these resource groups there will be a virtual machine i'm calling the first one production resource group and the second one staging resource group and after deploying these two environments identical environments i'm going to install a sample web server to make this an actual demo now let me copy all these commands here and i'm executing this on my azure cli all our resources are ready now let's see the resources on my azure portal as you can see we have two resource group and if i go inside we can see that i have the virtual machine and all the other resources that this virtual machine needs and if i go into staging resource group you can see the same setup here as well for this demo i have used these resource groups to manage these identical environments but you can find creative ways but this is a standard way of doing this using resource groups to separate the environments so the next step is enabling http traffic to this virtual machines and after that installing web servers let me do that now i'm going into networking and here i'm going to add inbound security rule and it's going to be http one let me change the name as well right now that is being created we have added to the virtual machine on our staging resource group now i'm going into production resource group and to that virtual machine and it working and here i'm going to add this inbound security rule for http traffic all right now let me install a purchase server in each of these virtual machines for that i'm going to ssh into these virtual machines and here i have wrote this script for installing apache server now while this is being installed in my production server let me go to staging environment here the virtual machine and then i'm going to copy the ip address of that as well now that is done going back to my zip portal and then let's say if i try to access this as you can see i'm getting a response and we are just invoking the endpoint directly and this is not what we want what we want is a load balanced way of accessing these virtual machines and for that we're using azure traffic manager now it's time for us to create our traffic manager profile for that i'm going to create a new resource group let me call it traffic manager rg region let me select that region now resource group is in place let me create the profile now all right as you can see we don't have much settings we can specify the name the globally unique name and then the routing method and then the subscription this is a globally deployed resource unlike a regional one now let me give a name here i'm going to call it cool app let's see whether that is available or not okay that is available and the next step is selecting our routing method here we have six routing methods available i'm going to go with weighted routing method and that is how we can implement the percentage based traffic routing between our two identical environments and here same subscription and the resource group and as i said this is a globally deployed resource on azure and let me click create all right our deployment is complete now i'm going to the resource and here as you can see we have the dns name routine method on the left we have few tabs if i go into endpoints we can configure the endpoints so basically these are the the compute nodes that process the requests i can click this and add our two virtual machines as endpoints to traffic manager profile and here we can select the endpoint type this can be an azure endpoint or it can be an external endpoint as well or it can be another traffic manager that you can deploy in a nested manner and we have a name and then we can provide a name and then and here we can select the type of the resource we have few options here it can be cloud service or app service or app service deployment slot or it could be a public ip address since we are working with virtual machines today i'm going to select the public ip address option now if i select that as you can see here we are informed that these two public endpoints cannot be associated with traffic manager endpoint and that is because we haven't associated a dns name to these ip addresses now if i click on it saying no dns name is configured now let me go back to my resource group for production environment and then i'm going into my public ip address and configuration here i can give a name to this public ip address let me give a name like production all right that worked let me click on save now let me go back to resource group again and i'm going into not the virtual machine public ip address and here configurations let me call here it we call it staging one all right as you can see this is the ip address of our staging environment and here i'm going to select a nice join point let me select let me call this production production endpoint and the target resource type is a public ip address and this is going to be this ip address here this property is interesting because you can provide a value from 1 to 1000 and you can provide these values for each of these endpoints that you create and this will decide the probability that the endpoint gets a hit so let's say for example you can provide values from one to thousand here so let's say you want to have 50 of your users directed towards the production environments when that is the case you can add 500 if you're adding 500 here you should add 500 to the other end point as well here i'm going to add 500 and 500 all right now that is done no custom headers are needed let me click add all right our production environment endpoint is now enabled let me click on add and as your endpoint this is i'm going to call it staging and environment and then the public ip address and this is the ip of that environment and here i can add 500 i'm adding equal values here to make the probability 50 50. now our two environments are in place now let me go to overview and as you can see here we have the dns name of this traffic manager i'm going to copy this and let's go into a new tab as you can see i'm getting a response from my staging environment and let me try refreshing this i'm not getting a response from production environment because we have cached dns on my browser here but if you wait for some time you can see that these switches between these two environments one other thing that you can try is if you go in to your command prompt and you can try to invoke a nest look up for this endpoint here let's see what happens and as you can see if you try it few times you can see that you're getting different responses for each of these environments if you go here to nslookup dot io and you paste the domain here and as you can see i'm getting this response let's try again and we're getting production now and staging now as you can see there's a probability of around 50 that we get these environments today we learned what blue green deployment is and then we saw how you can configure that on azure if you have any further questions or comments leave them down below and don't forget to like this video and subscribe if you learned something new today and thanks for watching you
Info
Channel: Meet Kamal Today - Cloud Mastery
Views: 78
Rating: undefined out of 5
Keywords: azure blue green, azure blue green deployment load balancer, azure blue green deployment slots, blue green deployment azure devops, blue green deployment, blue green deployment azure, blue green deployment strategy, blue green deployment strategy azure, azure traffic manager, azure traffic manager blue green deployment, blue green deployment example, what is blue green deployment, step by step
Id: ytKziDTmBUE
Channel Id: undefined
Length: 11min 44sec (704 seconds)
Published: Tue Nov 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.