EMAIL SUPPORT

dclessons@dclessons.com

LOCATION

US

LAB: Configure & Test HTTP(S) Load Balancing

LAB: Configure & Test HTTP(S) Load Balancing

LAB: Configure & Test HTTP(S) Load Balancing

Task

  • Login into the GCP Console.
  • Configure an Instance Template & an Instance Group.
  • Configure a Firewall Rule and Reserving an External IP address.
  • Configure Target pools and forwarding rules.
  • Configure a health check & Test Http(S) Load Balancing

Solution:

Task 1: Configure an Instance Template:

Select a Compute engine from main menu | Click instance template | Create Instance Template

Under a Create an Instance Template | Name: dclessons-instance-template-1 | Machine Configuration: General Purpose: Series: N1, Machine Type: n1-standard-1

Under Identity & API Access | Service Account: Select No Service Account | Under Advance Option | Select Management

Under Automation | Put provide Code:

#! /bin/bash
apt-get update -y
apt-get install apache2 -y
apt-get install php7.0 -y
a2ensite default-ssl
a2enmod ssl
mv /var/www/html/index.html /var/www/html/index.php
vm_hostname="$(curl -H "Metadata-Flavor:Google" \
http://169.254.169.254/computeMetadata/v1/instance/name)"
echo "Welcome to Dclessons, given text is served from: $vm_hostname" | \
tee /var/www/html/index.php

Click Create

Once Instance Template is created, it will be shown in template section

Task 2: Configure Instance group

Click on Compute Engine | In Left Side bar: Click on Instance Group

Under Instance Group | Name: dclessons-instance-group-1 | Select Instance template: dclessons-instance-template-1| Location: Single Zone| Region: us-central1(lowa), Zone: us-central1-a

Under Auto-Scaling: Mode: Select On: add and remove instance to and from the group | Minimum number of instance: 1| Max: 2

Expand Auto scaling Metrics section| Edit Signal: Under Signal Type: CPU utilization | Target CPU Utilization: put 80 | Leave other setting as it is and click on Create

Task 3: Create A Firewall Rule

Login to GCP Console | Click on VPC Network | Click on Firewall

Click on Create a Firewall Rule


Comment

    You are will be the first.

LEAVE A COMMENT

Please login here to comment.