0:02 Let's continue further and in this
0:04 chapter we are going to talk about the
0:06 Google cloud load balancer. So this is
0:08 the target architecture diagram which
0:10 you can see which we will be
0:13 implementing into our demo. But don't
0:14 worry we are going to break everything
0:16 down and we are going to start from the
0:18 scratch so that we understand how the
0:21 load balancer work. But let me give you
0:23 a little walk over on what are the
0:25 different component which we need to set
0:29 up a global external load balancer. So
0:31 here you can see on the left hand side
0:33 this is uh any user who is sitting
0:35 anywhere in the world that can access
0:38 the external uh load balancer with the
0:40 IP address. Remember we are only
0:42 performing the load balancer setup. We
0:45 are not performing any DNS a record or
0:47 URL mapping to this particular load balancer.
0:49 balancer.
0:51 After that you need to configure the
0:53 front end. Don't worry I'm going to
0:54 explain what the front end is and what
0:56 are the component which we need to
0:58 include inside it. But in a brief it
1:00 will require a protocol and a port and
1:03 protocol would be HTTP and port can be
1:06 anything on your application. After the
1:08 front end is configured then it comes to
1:10 the backend services or the back end
1:12 which we call it. So in the back end
1:14 which we need to create a backend
1:16 service and that backend service will
1:19 consist of health check health check of
1:21 your virtual machine which is sitting
1:23 over here which you can see. Secondly,
1:26 the protocol again what the protocol or
1:28 which kind of protocol your application
1:30 is supporting which is uh running inside
1:33 your virtual machine. So it can be HTTP
1:36 mostly it is HTTPS or HTTP.
1:38 Second the port and port again it
1:40 depends upon what kind of application
1:42 you're running and which port it is
1:45 running. It can be 80, it can be 9,000
1:47 any port which you want to configure for
1:50 your application. After that there is a
1:54 instance group. So these four component
1:56 will comprise to create a backend
1:59 service. Okay. So I have explained
2:00 health check which will keep on checking
2:02 the health then protocol uh which
2:04 protocol it is supported then port and
2:07 the final one is the instance group. The
2:09 instance group is bit special and it is
2:11 it is a logical group. So we need to
2:13 create an instance group and in that
2:15 instance group we will be clubbing or
2:18 grouping the virtual machine. So here
2:20 you can see this is a instance group
2:22 which we need to configure and in this
2:24 instance group we can add and remove the
2:27 virtual machine and add and remove which
2:29 means like if you are adding more and
2:31 more virtual machine then this
2:33 particular external load balancer will
2:35 be able to route the traffic on those
2:37 virtual machine. So right now here you
2:38 can see there are three virtual
2:41 machines. So external load balancer will
2:43 try to route the traffic or distribute
2:45 the traffic on these three virtual
2:47 machine. You can have a one virtual
2:49 machine also into the instance group but
2:51 that doesn't make any sense because one
2:53 virtual machine then why do you need a
2:55 load balancer but that's not a point.
2:58 The thing is uh in an instance group you
3:01 can have from one to more than one
3:03 virtual machine. So first we are going
3:06 to perform this demo with one virtual
3:08 machine and then later on we will be
3:10 adding the more virtual machine into the
3:13 same instance group. Let's start with
3:15 the demo and if you are directly coming
3:17 to the load balancer chapter then in our
3:19 previous chapter we have configured the
3:23 VPC uh our subnet and in that subnet we
3:26 have also configured the virtual machine
3:28 firewall. So that kind of a setup we
3:30 have already done. So now we will start
3:33 with the load balancer setup. So we'll
3:35 continue from here and if you want to
3:38 know like how this things works like a
3:40 VPC subnet and virtual machine then
3:41 please refer to the previous chapter
3:44 where I have explained the VPC subnet
3:46 and how to perform these kind of a setup
3:49 onto the Google cloud. All right so
3:50 let's get back to the topic of a load
3:53 balancer. So here you can see this is
3:56 our uh current setup and here we need to
3:59 add an external load balancer. So if you
4:00 move further then here we will be
4:03 creating our first external load
4:05 balancer and here I will be working only
4:08 onto my public subnet. Since this
4:11 virtual machine is public but still I
4:13 would like to set it up through the
4:15 external load balancer so that I can
4:18 have a multiple virtual machine running
4:20 inside my subnet and my external load
4:22 balancer should be able to route the
4:25 traffic onto those virtual machines. Now
4:27 let's jump back to our Google cloud
4:29 console and see where our where we can
4:31 create our external load balancer and
4:33 where is our virtual machine currently
4:37 present. So I will switch to my Google
4:39 cloud console and here you can see this
4:42 is the search box where you need to type
4:45 uh load balancer first of all. So if you
4:47 click on load balancer
4:49 then here this is the section where we
4:51 will be creating our first load
4:54 balancer. Okay. Next thing we need to
4:56 also verify where our virtual machine
4:59 is. So here again in the search box you
5:02 can type VM instances
5:04 and here you can see there are couple of
5:05 virtual machine. So here we are going to
5:07 target the public virtual machine. All
5:09 right. So first we are going to start
5:11 with the single virtual machine and then
5:13 later on we will be adding more virtual
5:14 machine towards the end of this
5:17 particular demo. Okay. Now get back to
5:20 our this particular tab where we need to
5:22 create our first external load balancer.
5:24 So here just click on create load
5:30 So here you will find a couple of
5:32 options. So one is our application load
5:34 balancer and network load balancer. So
5:36 we are interested into our application
5:40 load balancer for our HTTP traffic. So
5:42 choose this option. Uh let's click on
5:45 next over here.
5:47 Then uh it is going to ask do you need a
5:49 public or do you need a internal? So we
5:51 are going to go with the public so that
5:54 I can access that public uh load
5:56 balancer from anywhere. So this is the
5:59 option I'm going to choose.
6:01 Click next over here.
6:03 Then here it is going to ask like a
6:06 global or a single region deployment. So
6:08 I'm going to go with this global uh
6:12 workload so that I can access uh or I
6:13 can deploy my virtual machine into
6:16 multiple regions and I can configure my
6:19 uh global load balancer.
6:22 And here this diagram also signifies the
6:23 same thing. So here you can see I can
6:25 spin up my virtual machine into multiple
6:28 regions. And but if I go with this
6:30 particular option on the right hand side
6:32 which you can see which is regional load
6:34 balancer then it will be spinning up a
6:37 virtual machine on a single region. So
6:38 that's the key difference between these
6:42 global and a single region deployment.
6:44 Let's go further. Click on next over
6:47 here and here you will find uh load
6:49 balancer generation. So here there are a
6:50 couple of more option like a global
6:53 external application load balancer or
6:54 you're going to go with the classic
6:56 application load balancer. So I'm going
6:58 to go with the uh global external
7:01 application load balancer. And here it
7:04 is uh few more advantage which you are
7:06 going to get over here is the advanced
7:08 traffic management. So that gives you a
7:10 little bit more feature on how you're
7:12 going to manage your traffic which is
7:13 coming through your external load
7:17 balancer to your virtual machine.
7:20 Okay. Then click on next over here. And
7:22 after that uh it will uh point you to
7:25 the screen where you can start putting
7:27 the values for your external load
7:29 balancer. So click on configure over
7:32 here. And here you can see uh the same
7:34 thing which I was explaining in the
7:36 beginning of this particular chapter is
7:38 the front- end configuration, backend
7:40 configuration, routing rules and then
7:43 you need to review and finalize. So we
7:44 need to set up first of all with the
7:46 front end. Then we are going to jump to
7:48 the back end and then we are going to
7:50 set up some routing rule. Routing rules
7:52 are very simple in this particular demo.
7:54 And then finally review and create that
7:57 particular load balancer. A short pause
7:59 over here. If you're really liking these
8:01 kind of a content on my YouTube channel,
8:03 then I'm soon going to come up with my
8:06 Google cloud course on UDI. I already
8:10 published a few courses on AWS and Azure
8:13 on my UDI. So please keep an eye and I
8:15 will be making a notification on my
8:17 community when I'm ready with my Google
8:19 cloud course and what you are going to
8:21 get with that particular course is quite
8:23 a lot of thing which I'm not going to
8:25 cover on my public YouTube channel. So
8:27 here you can see this is a terapform
8:29 repository which I have already created
8:31 for my ODMI courses where I will be
8:34 composing the same demo uh with the
8:36 terraform because in industry we work
8:39 with the terapform not with the UI. So
8:41 yeah that's that's uh the depth I will
8:44 be uh going through in my ODMI courses
8:46 and also I will be covering various
8:48 scenarios which uh which is really
8:51 useful for industry when you are working
8:54 with the cloud uh such a cloud services.
8:56 So keep an eye uh on my announcement
8:59 when I I'm ready with my Google cloud
9:01 course. Uh let's get back to the topic.
9:04 Now we need to create our load balancer
9:06 name and also most importantly we need
9:08 to create a front- end configuration. So
9:10 let me show you the uh diagram which
9:12 will help you to understand. So right
9:15 now we are setting up the load balancer.
9:17 This virtual machine is already existing
9:20 onto my subnet. So the next thing which
9:22 we need to set up over here is the front
9:24 end configuration which you can see. So
9:26 here we are going to specify the
9:28 protocol port and we are going to assign
9:31 the name to our external load balancer.
9:34 So let's get back to our screen over
9:36 here and I'm going to copy the name of
9:39 my load balancer from my uh notepad so
9:40 that we can continue following the
9:43 naming convention. So here I'm going to
9:45 put the name of the load balancer. So
9:48 which is this one uh like a CL external
9:51 LB sandbox Europe not. So I'm going with
9:55 the more meaningful name over here. Now
9:57 the front end configuration. So here you
10:00 need to enter the name. So here probably
10:02 we can check put a name something like
10:11 LB
10:14 and after that you can put Europe not to
10:16 or whatever you want to put it uh over
10:18 there just to identify that it is
10:21 belonging to which region. So after that
10:24 or maybe we can just remove that uh
10:25 region as well because it's external
10:27 load balancer so we don't need to put a
10:29 name over here. So I'll go with the
10:31 normal name like external LB sandbox.
10:33 And here also I will be removing this part.
10:35 part.
10:38 Okay. So after that you need to choose a
10:41 protocol. So it is going to be HTTP. And
10:42 after that we need to specify the
10:44 application where it will be running. So
10:46 it will be running on a port 80. It
10:48 depends like if your application is
10:50 running on some other port then please
10:52 use that particular port. And remember
10:55 we are not configuring HTTPS yet. So
10:57 that's why I'm using the protocol HTTP
11:01 over here. Okay. After that uh click uh
11:03 that the front end configuration is
11:05 completed. Now let's move to the second
11:07 part which is the backend configuration.
11:09 So on the left hand side you will find
11:10 the option to click on backend
11:13 configuration. Now click on the backend
11:15 configuration over here and here you can
11:17 see uh you need to create a backend
11:20 service and the configuration. So in
11:22 this backend configuration you will find
11:25 a drop-down over here which will include
11:27 the backend services. So we need to work
11:29 on the backend service and that backend
11:32 service will help us to uh create the
11:35 group uh the instance group the health
11:37 check to point to our virtual machine.
11:40 Okay. Uh I'll show you the presentation
11:42 once again so that you can understand.
11:44 So now we have done this part which is
11:46 this one. Now the next thing which we
11:48 need to create is the backend
11:49 configuration. So here if you go over
11:51 here then we are creating a backend
11:53 service and in that backend service we
11:55 will be setting up the health check
11:59 protocol port instance group. All right
12:01 let's continue over there onto the
12:03 screen. So here in the drop-down you
12:05 will find a service like create a
12:07 backend service. So we need to choose
12:09 this particular service over here. Click
12:11 on backend service
12:13 and here we need to put the name. So
12:16 again I'm going to copy some meaningful
12:20 name from my uh notepad. So here this is
12:24 the name. So CL backend service sandbox
12:27 instance group. So here we are going to
12:30 put our request or our load balancer is
12:32 going to redirect our request to the
12:34 instance group. Instance group is a
12:36 group of virtual machines. So here the
12:38 back end type will be our instance
12:40 group. So here you can see there are
12:42 various option but here we are keeping
12:43 the things simple instead of using
12:46 complex like a GKE and all those cluster
12:48 we are keeping it to the virtual machine
12:50 which is our instance group select that
12:53 one protocol again the protocol is going
12:56 to be the same HTTP and the port we need
12:58 to put over here is 80 because that's
13:00 where our application would be running
13:04 so here I'm going to put a port
13:07 which is 80 oh sorry here it is not
13:09 going to be the port it is going to be
13:11 the same HTTP. So let me undo this one.
13:13 So it is going to be the named and port.
13:15 So which is going to be our HTTP
13:17 timeout. We are going to keep it
13:19 default. Don't change it 30 second. If
13:21 you want to change it that's fine but
13:23 let's keep it default. The next
13:25 important thing over here is the health
13:27 check. So we need to create our health
13:31 check also. So if I show you onto my
13:34 presentation then I'm talking about this
13:36 particular health check. So this health
13:38 check will keep on continuously checking
13:41 the health of our virtual machine and
13:42 the application running inside that
13:45 virtual machine. So this backend service
13:47 is also comprises of health check which
13:49 continuously monitors the health of
13:51 virtual machine. So that if a request if
13:54 if by any chance if this virtual machine
13:56 goes down and there is another virtual
13:58 machine running which is healthy then
14:01 this load balancer will try redirect the
14:03 traffic to this healthy virtual machine
14:06 instead of this one. So that's why we
14:08 you need a health check and you need to
14:10 configure a health check inside your
14:14 backend service. Now let's get back and
14:16 here in the drop-down you will see there
14:17 is no health check. So we need to create
14:20 a health check over here and here you
14:22 can put a name to the health check. So
14:24 let me copy the name from my notepad and
14:27 we can put a health check name over here
14:29 as well.
14:31 So the name I'm going to put is CLVM
14:34 health check sandbox. Description uh if
14:36 you want to keep it then keep it and uh
14:38 otherwise it is optional. The protocol
14:40 and the port is going to be TCPN port is
14:43 going to be 80. After that, the health
14:46 check criteria. Uh if you want to keep
14:48 it a little bit low, you can keep it low
14:50 as well. Since it's a demo, so I'm
14:51 keeping it 2 seconds. It's a bit
14:53 aggressive, but you can increase it to
14:56 five or 10 seconds as well. After that,
14:59 uh I am going to click on create over here.
15:01 here.
15:03 And here you can see our health check
15:07 will be created uh for my load balancer
15:09 backend service. Okay. So here you can
15:11 see our health check has been created
15:13 and associated with my backend service.
15:15 Let's move further and the next thing
15:18 which we need to create over here is the
15:20 instance group. So let me show you over
15:22 here into this particular uh diagram
15:25 over here. So here we need to create a
15:27 instance group and uh in this instance
15:30 group uh we will be adding the virtual
15:32 machines. All right. So right now health
15:35 check is done, protocol is done, port is
15:36 done and now we are working on the
15:39 instance group. So let's see from where
15:41 we can create a instance group. So again
15:43 go back uh to our console and here you
15:45 can see the previously we were here
15:48 health check has been created and if you
15:50 scroll it down then you will find a back
15:52 ends. In the back ends you will find a
15:54 instance group drop-down which is this
15:56 one. So let's click on this one and see
15:59 what we have. So there is no instance
16:00 group which we have created. The list is
16:03 completely empty over here. Now what we
16:06 need to do, we just need to go to uh the
16:08 new tab over here. Uh probably I think I
16:11 need to recreate the same setup once
16:13 again, but don't worry uh I I'll show
16:18 you. So here uh instance uh group click
16:21 on this instance groups over here and
16:24 here you need to click on instance group
16:26 option. So let's click on this instance group.
16:29 group.
16:31 Here you will find three options like uh
16:33 managed instance group, manage instance
16:37 group, stateful, stateless and stateful.
16:39 Then unmanaged instance group. So I'm
16:41 going to go with the unmanaged instance
16:43 group for this particular setup. Let's
16:45 click on this unmanaged instance group
16:47 setup. Here you need to enter the name
16:49 of instance group. So let me copy the
16:52 instance group name. So let's go with
16:55 this name over here. After that
16:58 description, it's optional. Secondly,
17:00 the location. So in which location you
17:01 are working. So if you take a look onto
17:03 this particular diagram then we are
17:05 working into the Europe North two
17:08 region. So I'm going to go with the same
17:12 location. So here I'll go and choose the
17:15 region which is our Europe North 2 which
17:19 is Stockholm region and zone. Uh here if
17:21 you are looking for any specific zone
17:23 then you can choose otherwise here you
17:25 will find all the three options. I'll
17:28 I'll explain how it how it works. Now
17:30 secondly the network. So if you take a
17:33 look onto our diagram then which VPC we
17:35 are working. So we are working onto this
17:38 particular VPC which is our CLVPC
17:40 sandbox and we are going to create this
17:43 instance group to mention that hey I I
17:45 will be working into this particular VPC
17:47 and this particular subnet over here.
17:49 Okay. So let's mention that particular
17:52 VPC from the drop-down in the network.
17:53 So which you can see over here which is
17:57 available after that uh subnet. So here
17:59 you can see there are two subnets which
18:01 is web and the private and if you take a
18:02 look onto the subnet then we are working
18:05 on the web subnet which is this one.
18:08 Okay. Now copy uh not copy but choose
18:10 the web subnet over here and here you
18:13 need to choose the virtual machine. So
18:14 here you can see the virtual machine is
18:16 visible which is we which we have
18:18 created. So let's select this virtual
18:22 machine and click okay. Check the name
18:23 of this virtual machine which is sandbox
18:26 bastion 01. So if you go to virtual
18:28 machine then here you can see sandbox
18:32 bastion 01 Europe North 2. All right. So
18:33 now we have created an instance group
18:35 and here we have selected one virtual
18:38 machine into it and after that uh we
18:42 just need to click on create
18:45 and also there is a one more thing uh to
18:47 send the traffic to this particular uh
18:50 port incoming traffic load balancer to
18:51 create a load balancer instance group.
18:54 So here we also mention here we can also
18:56 mention the port. So here click on the
18:58 port and port which we are going to
19:02 mention is like uh let's say TCP and the
19:04 port number is going to be 80 because
19:06 this is the port where our traffic will
19:09 be landing or from where our application
19:12 will be serving the request. After that
19:15 click on create over here.
19:17 And here you can see our unmanaged
19:19 instance group has been created. All
19:22 right. Now let's get back to our load
19:24 balancer setting which we were doing. So
19:27 here if you go okay now since uh my
19:29 instance group was not ready so the
19:31 backend service configuration which I
19:34 was creating uh was lost. So again I can
19:36 retype those configuration. So again
19:38 I'll start but don't worry our some of
19:41 the configuration are still saved. So
19:43 here let me start with the backend
19:45 service once again. So I'll copy the
19:47 name over here which is this one which
19:49 is instance group. I need to select it.
19:52 Protocol HTTP network named port is
19:54 going to be HTTP. Health check which we
19:56 have already created which is this one.
19:58 So it is still there. Instance group.
20:00 Let's see if it is popping here. You can
20:02 see the instance group is now visible.
20:04 All right. So select this instance group
20:06 over here.
20:09 Use existing port name. Uh instance
20:10 group has a named port name. Do you want
20:13 to use the TCP for this backend service?
20:16 Uh I can choose use existing port. Yeah,
20:19 that's fine. After that uh back end
20:21 utilization so here you can uh configure
20:24 the rate uh custom matrix and utilization.
20:25 utilization.
20:27 So I'll keep the things default over
20:29 here. We don't need to change anything
20:32 at this point of a time. After that uh
20:35 we are pretty much I think good with the
20:37 backend services. Once you verify all of
20:39 these details then what you can do is
20:42 you can go at the bottom and here we
20:43 need to click on create option. But
20:45 there are few more things which you can
20:47 verify at the bottom. what are those? So
20:49 there are a few more details which you
20:52 can see over here is like uh cachier
20:53 mode. I'm not going to change. I'm going
20:55 to go with the recommended setting over
20:58 here. After that uh at the bottom you
21:00 will also see the cloud armor policies
21:02 and all those things. So I'm going to go
21:04 with the default one. I'm not going to
21:06 change anything. We're going to take a
21:08 look onto those later. Uh the more uh
21:12 cloud armor how cloud cloud armor works.
21:14 After that uh yeah I think we are pretty
21:16 much good with the back ends uh
21:18 configuration then click on uh create
21:21 option over here
21:24 click on create
21:26 uh let's see make sure all the fields
21:28 are correct okay let's see what field we
21:31 have missed over here
21:34 and let's go one by one all right so
21:36 here you can see uh it is complaining
21:38 for this policy name because it's going
21:41 to assign the default name to it and I
21:44 have previously uh like practicing this
21:46 particular thing. So this name is
21:49 already occupied. So what I can do I can
21:51 just uh add a 01 over here so that I
21:54 don't get a conflict over here. Okay.
21:57 Now after that click on create
22:01 and click on okay over here. So now my
22:03 front end backend configuration has been
22:05 created. Let's take a look onto the
22:07 routing rules. So click on routing rules
22:08 over here. [snorts] So here we don't
22:10 need to change anything because we our
22:12 routing is very simple where our
22:14 external load balancer is capturing the
22:16 request and sending it to our virtual
22:19 machines. Okay. After that uh click on
22:22 review and finalize. So here you can see
22:24 you will verify all of these details. So
22:27 which is our front end which is uh run
22:29 accepting the request on a board at
22:31 routing rules it's all default over
22:33 here. Backend service here we have
22:35 created a back end. This is our health
22:38 check. And this is our security policy
22:41 and these are our backends with our uh
22:44 instance group. Okay. After that you can
22:46 just simply go and click on create over here.
22:48 here.
22:50 So I'll just go over there and click on
22:53 create. And after that uh here you can
22:56 see uh this is creating our load
22:59 balancer. So it will take a few minutes.
23:01 I'll be back once this load balancer is
23:03 up and running. All right. So after a
23:06 few minutes my load balancer is up and
23:08 running. So here you can see the load
23:10 balancer has been created and the
23:13 backends are green right now. Uh we need
23:15 to do few more checks over here. So if
23:17 you click on this particular one then
23:19 here you will find a more details like
23:22 health checks. So here if you go and
23:25 take a look onto this one if your uh
23:28 load balancer is not working then please
23:30 go and check this particular health
23:32 status because many of the time your
23:34 health checks will be failing and then
23:36 you need to take a look on which port
23:38 you have configured is your application
23:41 running inside your virtual machine or
23:44 not. Okay anyway since uh my health
23:46 checks are green everything is working.
23:48 So here you can see on the top that this
23:51 is the public IP address which I got. So
23:53 I can copy this public IP address from here
23:55 here
23:58 and go to the new tab and hit enter. And
24:00 here you can see it is pointing me to
24:03 the application uh which I'm running
24:05 inside my virtual machine. So this is
24:07 the IP address of that particular
24:09 virtual machine. I'll show you this uh
24:11 particular virtual machine. So here on
24:14 the VM instances which you can see this
24:16 is the IP address which I'm talking
24:18 about. So this is how we are able to
24:20 redirect the request to this particular
24:22 virtual machine. Now you might be
24:24 wondering that which application and how
24:26 I have configured this particular page.
24:30 So here uh onto this particular virtual
24:31 machine. So here I have already logged
24:33 in into this virt virtual machine over
24:36 here and here I am running that
24:39 particular uh application which is uh
24:42 which is just an Apache web application.
24:45 So I will post that particular
24:47 instruction like how to install those
24:51 Apache this uh like a basic HTML page
24:54 which you can do and go and test uh with
24:56 your load balancer setup. So this setup
24:57 is very simple. Please check the
24:59 description section where I will be
25:01 uploading these particular script to
25:03 install the Apache and this basic HTML
25:08 page. Okay. So uh so that's how uh we
25:10 are going to configure the load balancer
25:12 and right now it is only single virtual
25:14 machine which I'm pointing but we can
25:16 add few more virtual machine into this
25:19 particular instance group. So let's take
25:22 a look onto the uh uh structure or the
25:24 implementation diagram which we have
25:25 been practicing. So here you can see
25:27 this is the virtual machine which is a
25:29 part of this particular instance group
25:32 and now the load balancer is able to
25:34 redirect the traffic. The next thing
25:36 which I would like to do is also to set
25:38 up a one more virtual machine inside
25:41 this particular instance group. So first
25:43 of all let's spin up a one more virtual
25:45 machine and then try to add that
25:46 particular virtual machine into this
25:48 particular instance group and then we
25:50 will see that it is able to redirect the
25:52 traffic or not. Let's create the virtual
25:54 machine. So click on this virtual
25:56 machine option over here.
25:59 Here I'm going to put a name. So let's
26:03 put uh uh cl uh
26:04 uh
26:10 bastion not bastion but uh test uh VM uh sandbox.
26:17 Okay. And put a name over here like a
26:19 01. And here I'm going to choose the
26:22 region as a Europe North 2 uh zone. I'm
26:26 going to keep it. Let's go with the A.
26:28 And uh after that I'm going to choose
26:31 the E2 over here. And here I'm going to
26:35 choose as uh E2 small.
26:37 After that advanced configuration, we
26:39 don't need to change anything. OS I'll
26:42 keep it Debian. Uh data protection I
26:44 don't need to worry about that part
26:48 much. Uh networking. Uh so here uh we
26:51 need to assign the network tag also. But
26:54 uh let's let's first check the network.
26:56 So here I'm going to choose the region
27:00 uh the VPC as a CL VPC sandbox. The
27:01 subnet I'm going to choose is the public subnet.
27:03 subnet.
27:06 Also let's verify few more things from
27:08 our existing virtual machine before we
27:10 add it. So let's get back to VM instances.
27:12 instances.
27:16 Uh click on this one
27:18 and here we need to check the network uh
27:21 tag. So this is the network tag which we
27:24 need to use exactly the same
27:28 uh which is over here. Okay. And after
27:31 that let's take a look onto the region
27:33 if that region information is available
27:35 over here.
27:40 So here let's take a look.
27:43 Yeah you can see it is a region. So
27:46 location is Europe North A. Okay. So
27:49 let's go further and uh we have assigned
27:51 this one. We have assigned this one. All
27:54 looks good. After that let's let's go to
27:56 the observability. We don't need to
27:58 change over here security. Here we need
28:02 to attach our access key. So here I'm
28:06 going to take a look on add manually
28:09 key. Uh let me copy the SSH keys from my laptop.
28:26 so here this is the public key which I'm
28:34 and let's get back to this one and after
28:34 that [clears throat] I'm just going to
28:37 click on create
28:39 so this is the virtual machine don't
28:42 worry if you feel that I was too quick
28:43 then Please refer to the previous
28:45 chapter where I have shown in very much
28:47 detail how to spin up your first virtual
28:49 machine. So please take a look. I'll be
28:51 back once this virtual machine is up and
28:53 running and then we will be adding this
28:55 virtual machine into our instance group.
28:57 So here you can see my second virtual
28:59 machine is up and running and this is
29:01 the public IP over here which you can
29:02 see. So I'll try to access that
29:05 particular virtual machine from here. go
29:08 back to my virtual machine
29:10 and here uh this is the command here I
29:13 will be changing the IP address and hit
29:16 enter and here you can see I'm able to
29:19 access my virtual machine
29:21 right now the next thing is I will be
29:23 installing my application I'll show you
29:24 how to install that particular
29:26 application and you can use the same
29:29 script to configure your basic HTML page
29:31 so this is the script which I'm going to
29:34 use uh so either you can create a shell
29:35 script Or either you can just simply
29:37 copy these instruction and go to your
29:39 virtual machine and do it do the
29:41 installation. So here it is going to
29:43 update the package manager. After that
29:53 and here you can see the Apache is
29:55 getting installed. It will take a few
29:57 seconds. It's fairly quick when you need
30:01 to install it. And uh after that we are
30:03 going to configure this uh like a basic
30:05 HTML page which you can see over here.
30:07 So this is just an simple HTML page
30:09 which will be putting like a host name
30:12 the IP address the host name and the IP
30:15 address so that we can identify on which
30:17 server the request is going. Okay so
30:19 let's take okay so Apache has been
30:21 installed. Now I'll clear the screen.
30:24 Now I need to become a root sudo sue and
30:27 after that I'm going to copy this
30:29 particular one
30:32 request uh a command and here just hit
30:35 enter. That's done. So here you can see
30:38 I have created this index.html page
30:40 which will be served and this is the
30:42 content host name and the strong uh IP
30:46 address. Click on exit from here and
30:48 after that we just need to restart the
30:51 Apache. So here I'll just copy this one
30:54 and here I'm going to restart it. Now it
30:56 has been restarted. [snorts]
31:05 Here you can see it is up and running
31:07 and then we can run the command curl
31:09 local host
31:12 to see if it is producing the output. So
31:13 here you can see it is producing the
31:15 output and the IP address has been
31:17 changed. Previously it was 1.7 and now
31:20 it is 1.8. Okay, so let me show you back
31:22 once again. So we have done the setup so
31:24 far that we had a one virtual machine
31:26 and one virtual machine was configured
31:28 to the load balancer. But now we are
31:30 spinning up a one more virtual machine
31:32 and trying to put that one into over
31:34 here. So this part we have done it
31:37 spinning up a virtual machine. Uh so here
31:38 here
31:41 so now we will uh be configuring inside
31:43 our this particular uh instance group
31:45 which where we already have a this
31:46 machine but we need to add this
31:50 particular virtual machine also. So
31:52 let's get back to our Google cloud
31:55 console and here let's take a look onto
31:58 the instance group.
32:01 Click on the instance group over here.
32:05 Click on this particular instance group
32:07 and here uh we just need to click on
32:10 edit because here we need to add it. So
32:12 here you can see this is only one
32:13 virtual machine now we need to add
32:18 another one. So click on edit over here
32:22 and uh here if you take a look then in
32:24 this particular dropdown you will find a
32:26 option of the second virtual machine
32:28 which we have recently added. So here
32:30 from the drop-down go over here and
32:32 select the second virtual machine.
32:35 Select that one. Click okay. And then
32:37 click on save this particular one. And
32:40 now our second virtual machine is also
32:42 added to our instance group. And once
32:45 this instance group is updated then load
32:46 balancer will automatically start
32:49 sending the request to this particular
32:52 virtual machine as well. So here you can
32:55 see uh now if you take a look onto this
32:56 particular page so both of the virtual
32:59 machines are added over here. Now let's
33:01 take a look onto the health status of
33:04 our load balancer and is it pointing to
33:06 both the virtual machine or not. So here
33:09 again go back to your load balancer and
33:11 here onto the load balancer name click
33:17 and if you go at the bottom then here
33:19 you can see the health status count has
33:21 increased from 1 to two because we are
33:23 having two virtual machine right now and
33:26 both of them are in healthy status. So
33:28 let's verify whether our load balancer
33:30 is able to request or route the request
33:32 or not. So here I'll copy the IP address
33:35 and here I think this is already there.
33:37 So I'll paste it. So here just refresh
33:39 the page. Right now it is pointing to
33:42 1.7. Let's refresh it. And now you can
33:45 see it is pointing to testvm. Sendbox 01
33:47 which is 1.8. And the IP address is
33:49 still the I'm using a single IP address
33:52 which is 182 which is of my global load
33:54 balancer. [snorts] So keep on refreshing
33:56 and see if request will keep on uh
33:59 routing to both the virtual machine. So
34:02 this is how this whole uh load balancer
34:04 setup will work. And right now I have
34:06 shown you only these two virtual machine
34:08 but you can keep on adding three, four
34:10 and more virtual machine to your