Get startedGet started for free

Lab Review: Configure an Internal Load Balancer

1. Lab Review: Configure an Internal Load Balancer

In this lab, you created two managed instance groups in the us-central1 region, along with firewall rules to allow HTTP traffic to those instances, and TCP traffic from the Google Cloud health checker. Then, you configured and tested an internal load balancer for those instance groups. You can stay for a lab walkthrough, but remember that Google Cloud's user interface can change, so your environment might look slightly different. So here I'm in the GCP console and in this lab, similar to other labs, we've actually pre-created some resources for you. You can explore those, again, if you go to a navigation menu and then go to deployment manager, you'll see a deployment here. We created a network with two subnets and some firewall rules. We can also just explore those by navigating to VPC network, that's what the lab instructions actually mention. So I can click there. I already have the default network and here is that extra network I've with the two subnets. And I also have some firewall rules for those right here, to allow ICMP and SSH, and RDP. So what we're going to do now, is we're going to create some more firewall rules, we're going to create one for HTTP, and then we're also going to create some for the health check. So let me just click create firewall rule, and this is going to be fairly similar to what we already did for the HTTP load balancer lab, the big difference is we now have our own network that we're going to apply this to. We're also going to have target tags, load balancer backend, IP ranges, we want to HTTP from anywhere and HTTP would be TCP-80, so we can click create, and then we're just going to repeat the same thing for the health checker. So let me copy the name of the firewall rule, apply it to the right network, have the load balancer backend as the target tag. Now the IP ranges, we're going to copy them one by one in here, so let me paste one, headspace, let me grab the other one, and paste that as well. And for now, I'm just going to do all ports under GCP, but you could be a little bit more specific depending on what you want your health checker to look for. So let's click create, and now we're going to configure instance templates and instance groups. So let me navigate to compute engine and then instance templates. And we're going to create a template in there and just call it instance template one then we click create. It's actually the name that's already in there. Then I can expand management security disnetworking. Now, a couple things, first of all, in the HTTP load balancer, we had a custom image, in this case, we're actually going to set up a startup script. So under the metadata, I'm going to provide as a key, the startup script URL and in a Cloud storage bucket, that's publicly accessible. We've placed a startup file and you could go in there and you could actually review that and the link to that is in the lab. Then I'm going to go to networking. I've created all these firewall rules, they apply to specific network tags, and they're also for a specific network. So let me make sure I have the right network selected and select denetwork tag, and this is going to be for subnet A. So now I can click create, and then we're going to create another instance template for subnet B. So let me just wait for this to be created, and then I'm just going to create another one from there by selecting it, and then clicking copy. It's going to change the name automatically, and the main difference is I now need to make sure I select the different subnet. This is going to be for subnet B, and then I click create as well. So once we have these up, we can now create the managed instance groups, so let me navigate to instance groups and start up by creating our first one, just call it instance group one. This is going to be a single zone. It's going to be in US central one A. We're going to use instance template one, and we're going to select the, this will be based on CPU usage, let's set 80 as a usage minimum of one maximum of five, and I could change the cool on period for example, to 45 seconds, and now I can click create. I could also attach a health check here or just attach that later to the load balancer. So let me click create, and we're going to repeat the same for the instant script two, and this is going to be now another one. It's going to be based on the other instance template also in US central one. Let's do that in B, for example, change the target CPU usage to match what we had earlier of 80 maximum of five, cool line of 45. And then we can go ahead and create that as well. So if I click on VM instances now, I should already have an instance from the first instance group and if I come back here, I had to refresh to see that other one, we can see that the other instances now being created for the instance group two. So we can, you know, verify, again, that they're being created here. So here we see, we have now one instance group each. So now what we can do is, we're going to create a utility VM to navigate to these instances. And so we can see also, by the way, if we look at their internal IP addresses, that they're both part of a different siter range, and if I click on nick zero here, we can see which network interface this is part of. You can see it's part of subnet A, that's correct. And if I click on the other one, we can see this is part of subnet B. Okay. So each subnet now has an instance group in it. So let me create another instance, this is going to be our utility VM. Now, an internal load balancer is regional, so I want to use the same region. We then configure the internal load balancer with a frontend and backend configuration, and test the load balancer from the utility VM to verify traffic is distributed across both instance groups. That concludes the lab walkthrough for configuring an internal load balancer.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.