Click on the hamburger icon on the top left corner
Select Compute Engine
Select Instance templates
Click on Create instance template.
Enter the name of your instance template i.e. whizlabs-instance-template. Do not enter any other name, It is required for validation of the lab.
Select the N1 series from the Series dropdown.
Select machine type as n1-standard-1. Do not choose any other machine-type, doing so might get your access to labs blocked.
Under this mentioned tab, Go to the Startup script
Enter the bash script to get these packages installed on the startup of instance. You can get this code from the Supporting Document named Instance Auto Script.
Click on create to finally create your instance template
You can now see the instance template created.
Select Instance groups from the menu in left sidebar
Click on create instance group.
Enter the name of your instance group as whizlabs-instance-group. Do not enter any other name, It is required for validation of the lab.
Select single zone for practice purpose
Choose region as us-central1 and zone as us-central1-a
Choose your instance template which you created in the previous steps.
Select autoscaling mode as Autoscale
Choose metric type as CPU utilization and Target as 80 which means once your CPU utilization goes above 80%, new instances should add up.
Enter minimum instances as 0 and Maximum as 5.
Click on create to finally create your instance group
You can now see your instance group listed.
Click on the hamburger icon on the top left corner
Select VPC network under Networking section
Click on Firewall
Click on Create firewall rule
Enter the firewall rule name as http-allow. Do not enter any other name, It is required for validation of the lab.
Choose the network as default
Enter priority number as 1000
Choose direction as Ingress as we are allowing all incoming HTTP traffic
Choose Allow as we want to allow the incoming traffic
Choose target as all Instances in the network. Same rule will apply for all the instances in the network
Enter the Source IP range as 0.0.0.0/0 which means Internet
Enter the port as 80 and check TCP as we are allowing HTTP traffic, HTTP port is 80
Click on create to create the firewall rule
Now, choose External IP addresses
Click on Reserve static address
Enter the name as whizlabs-ip. Do not enter any other name, It is required for validation of the lab.
Choose the tier as Premium because we are creating .
Choose IPv4 as IP version
Select type as Global. At this point we are just reserving the IP address and not attaching it to our load balancer, once we configure the load balancer, then we will attach IP.
Click on Reserve to reserve your Static IP address
Select Network services under the Networking tab
Click on Create load balancer.
Choose HTTP(s) Load Balancing and click on Start configuration.
Choose the Internet-facing option and single region and click on continue.
Click on Continue
Enter the name of load balancer as http-lb. Do not enter any other name, It is required for validation of the lab.
Click on the Backend configuration
Choose Backend services and Click on Create a backend service.
Enter the name of backend service as backend-server.
Keep these mentioned options as default.
Choose your instance group which will serve as your responding backend server.
Enter the port number as 443.
Keep the other fields as default.
Click on Done.
Click on create a health check
Enter the name as server-health and leave options default. Do not enter any other name, It is required for validation of the lab.
Click on Save and continue.
Click on Host and path rules to set URL Path.
We are choosing a Simple host and path rule as default.
Click on frontend configuration
Enter the name of your forwarding rule which will act as the frontend of your application from now onwards and you will attach the reserved static IP to this frontend.
Choose the Protocol as HTTP.
Choose network tier as Premium.
Choose the type as Global.
Choose your reserved IP address. This forwarding rule will redirect you to your instances in the Instance group
Choose port as 80 as we are allowing only HTTP traffic
Click on Create a new certificate.
Enter the name of Certificate.
Choose Create Google-managed certificate. You can select Self-managed as well if you have one.
Enter your domain name.
Click on Create.
Keeping other options default. Click on Done.
Click on create to finally create your load balancer
You can see your loadbalancer listed
Click on Cloud DNS.
Now first enable the API.
Click on Create Zone.
Choose Zone type as Public.
Enter any friendly name.
Enter your DNS name
Click on Create.
Click on Add Record Set.
Choose Record Type as A, Enter your Static IP which you created to point to your DNS and Click on Create.
Enter DNS name as www.whizlabs.in. and Record Type as CNAME and Canonical name as whizlabs.in. , You have to add a (.) dot in the end and Click on Create.
You can see the DNS Data, you need to update these Name servers in your Domain provider. It might take 48hours to update.
Now go to your Load Balancer.
Check the Certificate which you create.
You can see the status as Provisioning, it might take up to 60minutes to update to Active, Once active you can enter https://yourdomain, you will see the result.