hello youtubers welcome to this video I'm in cod and this is just me an open source channel welcome to this video and this one is the second video in the hto series which is part of the kubernetes series so if you haven't watched my previous video it's about an introduction to a steer the service mesh and how to install these to your CDL and the East EO is toc dl components on your Kuban I discussed sir so if you want to follow this video the recommend recommendation is you have to have a cluster with helmet tiller installed and metal lb and East your CT alone your Cuban I discussed or if you want to know how to do that please watch my previous video right as promised in my previous video we are going to look at how to deploy the sample book in for application in our Cuban and s cluster okay so I'm going to search for the history of documentation sto book info ok sto book in full application so that's one of the sample application and I think that one really covers most of the topics most of the features of history we can use this application okay so that's the architecture here so we have a product page ok so that's a landing page we're going to product page all the requests coming out coming in to the cluster will be for the product page which is a Python based application micro service and we've got another micro service for reviews and we have details micro service that's written in Ruby and the reviews is written in Java and the ratings micro service is written in node.js so this is to show you how you can integrate your micro services that has been written in different programming languages so that doesn't matter which programming language you use different micro services how to interrelate how to do service discovery traffic management load balancing secure communication so those are all the concepts you are going to cover in this sto series so the application we are going to be using is book infill so that's the quick architecture of the application we have one version of product page micro service and we have three versions of reviews one version of details and one version of ratings micro service so this is to show you how to configure traffic policies routing policies and so on okay so reviews version one we've got version 2 and version 3 when user goes to the product page they see the reviews right so the first one reviews micro-service is on its own it doesn't have any rating at all the second version of the reviews micro-service has got ratings so this reviews version 2 micro service calls the ratings micro service to pull the ratings from a different micro service and version 3 of the reviews micro service has been enhanced to show a little more color so basically the black colors are version 2 and in version 3 they have just changed the code to all red that said and version one of the reviews doesn't have the rating functionality this is to show you how to root your traffic to different versions of the micro services so that's the architecture of the application we are going to deploy deploy the application as you can see here we are going to create an ingress gateway in the front so that's your gateway that's the entry point for your application and for each of these service we are going to deploy a sidecar or NY proxy so that's the entry point for each of the micro services ok let's see how to install it ok the first thing is the armor you deploy the application that you want to manage using is toc TL that namespace has to have this label added sto injection equals enabled so let's do that we go and install all these resources for booking flow in the default namespace so we need to name we need to label the default namespace cube serial label namespace default sto injection equals enabled canny cube CDL get namespace - - show labels and you can see here the default namespace is now has the label sto injection equals enabled so that's good deploy your application using cube serial commands samples booking fill make sure you're in the directory value of downloaded sto from my previous video and we can do cube serial create - s create or apply witch or you want to get use samples book info platform cube book info dot llamo ok ok that's done let's look at the resources cube CDL get all ok so as you can see here it has deployed a number of resources servers service accounts deployment and all those details and down here you can see there's the details version 1 which is here so that's the details micro service it has got only one version so we've got version 1 product page version 1 so that's this micro service written in Python which has got only one version and ratings it's this one which has got one version and for reviews you've got 3 points because we are running three versions of reviews micro service version 1 2 & 3 and we've got the service so all these micro services are exposed as a service and the deployments so details product page ratings and the three versions of the reviews micro service ok at the moment part is initializing let's give it a few minutes so it's downloading all the required container images and it should be ready in a few moments alright so everything is running except rating so that's also running so ok cool we are all good now control see what else we need to do we have deployed the application but we can access it we need to do an extra step to make it accessible inside that less stressful less outside the cluster from outside the cluster if you are running okay so that's what we have done let's verify if everything is running okay cube CDL get serviced all right cubes CDL get parts everything is running we are good now and to confirm that the begin for application is running send a request to it by a curl command from some part ok let's look at that cube CTL get fonts so the idea here is to see if the application is actually running so from here we can see that the parts are all running but actually we need to test whether the application is running so at the moment we can access this application from outside the cluster but we should be able to access the application within the cluster so I'm gonna log into one of the parts here and then use the Corrib commands to access the product page let's see if it works cube CTL exec - IT for interactive let's login to the ratings pod you need to specify what command to run for example shell ok so we are inside the ratings container which CRO we have curl and if I do curl what's the command curl product page and grep for title ok let's do that cube CTL get this and you can see we are trying to access the product page on 4th 90-80 product ok curl product page : 90 80 slash product page is the URL ok cool so there you go we have the web page actually so where is the title summary and yeah title simple bookstore app so it seems to be working fine control tree so that's one way of testing the first testing to see if the application is accessible within the cluster so we have checked that determining the ingress and pour'd we don't have to do that because we know what the ingress IP is you have CDL - n/a steel system get service sto ingress gateway 71 72 . 17 dot 0 dot 200 so that's the ingress IP and the port is 84 huts TTP and we have to create an ingress gateway so that we can access the application from outside the cluster so I'm going to try and access the application from my host machine into the cluster so we need to create a gateway cube CDL get gateway we don't have any gateways we need install it using this command so the manifest is in the samples directory cube CDL create - F samples look in so networking book info gateway don't Yama's ok so it has deployed a gateway and a virtual service cube city I'll get gateway ok so we've got that cube CTL described gateway looking for gateway right so we have that ingress gateway defined on port 80 go let's try to access this now should we be able to access it now ok so that's there we know the Gateway URL which is the ingress host and the ingress port if you're running darker don't worry control the app is accessible from outside the cluster okay now let's try and access the application so the load balancers IP address is 170 2.17 dot 0 dot 200 cubic cell gets Liz - n is tio system get service is tio ingress gate way ok so load balancer and 172 17-0 200 let's try and access it 172 dot 0 dot 200 Co it's not working because we don't have anything on serving on the route document so we have to prefix product page all right the comedy of errors cool so we have signed into our application we can access the application from our host machine so that's book info sample the comedy of errors so that's a sample book details of the book and the book reviews and extremely entertaining you play by Shakespeare entertaining play by Shakespeare ok so as you can see here there are no ratings which means if we go to our book info application so there are no ratings means it's using the version 1 of the reviews micro-service so it is load balancing between these three versions of the reviews so I can show that by refreshing the the URL so when i refresh the URL the request will be load balanced between these three micro-services version 1 version 2 1 version 3 let's check that out ok refresh ok so now it's all grade which means it's version 3 of the ratings sorry of the reviews micro-service now it's version 1 now it's version 2 because all black version 3 version 2 version 1 version 3 version 2 version 1 so that's the load balancing so now the default policy is to allow traffic to all the versions of the microservice on a round robin round robin fashion so we are going to use this book info sample application to explore the traffic routing policy so in the future videos we'll be sending traffic to a particular version for example based on a request header so if a request is coming from a particular browser agent like Android or Firefox or mobile agent or whatever it is and direct the request to a specific version of the reviews micro service or if a request is coming from a specific person direct that traffic to a specific version of the microservice and all sorts of traffic management we are going to look that look at that so we have deployed a booking for sample application with no specific rules so it's going on a round robin fashion to all the versions of the reviews micro service alright cool I think that's all I wanted to show you in this video and if you've got any doubts or any questions please let me know in the comments I'll be able to respond to you at the earliest I can and if you like this video please share with your friends and don't forget to subscribe to my channel so I've done two videos on each TL this is based on requests from many users so make sure you've got everything understood and make sure everything is working in what in your environment and if you've got any questions please try to explain your problem in as much detail as possible that will really help me to understand and help you to resolve your issue alright thank you so much for your time watching this video today I will see y'all in another exciting sto video next time see you for my