MultiCloud Classroom notes 20/Jan/2025

Load Balancers in AWS

Setup for LoadBalancing

  • Lets create an 2 AMI for 2 websites in it
  • Setup steps for Website 1 – boxer
sudo apt update
sudo apt install nginx unzip -y
cd /tmp
wget https://www.free-css.com/assets/files/free-css-templates/download/page296/oxer.zip
unzip oxer.zip
sudo mv oxer-html /var/www/html/boxer

Preview
* Setup for Website-2 – Gym

sudo apt update
sudo apt install nginx unzip -y
cd /tmp
wget https://www.free-css.com/assets/files/free-css-templates/download/page296/neogym.zip
unzip neogym.zip
sudo mv /var/www/html/neogym-html/ /var/www/html/
sudo mv /var/www/html/neogym-html/ /var/www/html/gym

Preview
* For AMI creation steps watch classroom recording

AWS Load Balancers

  • AWS has 3 types of load Balancerss
    • Network Load Balancer: This is layer 4 load balancer
    • Application Load Balancer: This is Layer 7 LB
    • Gateway LB
  • AWS has a classic load Balancer which supports both layer 4 and Layer 7 (old generation) and is not recommended anymore.
  • Our focus will be on ALB and NLB
  • LB’s can be private (within vpc) or public (from internet)
  • LB will forward the request to different zones via subnets
  • LB will have a security group
  • Listeners and routing is about configuring rules
  • Target group represents the instances where the traffic has to be forwarded. Target group one or more instances in different zones

Layer 4 LB with boxer website in our vpc

  • Lets create a vpc with minimum 2 public subnets in 2 AZs
    Preview
  • Create a security group to open tcp 80 port
    Preview
  • Now create two ec2 instances in 2 subnets (autoscaling group)
  • Make this two ec2 instances as a target group
  • Now create a Layer 4 LB (NLB) with
    • rules
      • 80 of LB will be forwared to 80 of Target group on TCP
        Preview

Layer 7 LB

  • Lets create a vpc with minimum 2 public subnets in 2 AZs
    Preview
  • Create a security group to open tcp 80 port
    Preview
  • Now create two ec2 instances in 2 subnets (autoscaling group) using boxer ami
  • Now create two ec2 instances in 2 subnets using gym ami
    Preview
  • Now create a gym target group and boxer target group
  • Now configure lister with a rule such that if the url has a path gym forward to gym target group and if path has boxer forward to boxer target group
    Preview
    Preview
  • Addons for Applciation Load Balancer

    • WAF
    • Global Accelarators

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube