Exercises – Load Balancing – ANS-C01 Study Guide

Exercises

  1. Read the application load balancer user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html.
  2. Read the network load balancer user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html.
  3. Read the gateway load balancer user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/introduction.html.
  4. Read the target groups user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html.
  5. Read the AWS autoscaling documentation: https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-a-scaling-plan.html.
  6. Read the AWS cross-zone load balancing documentation: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-subnets.html.
  7. Read the AWS autoscaling documentation: https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html.
  8. Read the Kubernetes controller documentation on GitHub: https://github.com/kubernetes/controller-manager.

Written Labs

Written Lab 4.1: Create a Network Load Balancer

  1. In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
  2. Select Load Balancers in the navigation panel on the left.
  3. Select Create Load Balancer.
  4. Click the Create Load Balancer box.
  5. Select Create Network Load Balancer.
  6. In Basic Configuration, name your load balancer and select Internal IPv4.
  7. In Network Mapping, select your VPC to place the load balancer into where the EC2 web servers reside.
  8. In Mappings, select one availability zone that is internal.
  9. In the Listeners And Routing box, leave the listener protocol at the default and select Create A Target Group.
  10. In Target Group Basic configuration, leave the target type as Instances.
  11. Name the target group and leave the protocol and port at TCP port 80 (HTTP).
  12. Place the target group in the same VPC as the network load balancer and where the EC2 web servers reside.
  13. Leave the health checks as TCP.
  14. Select one or more EC2 instances and click the Include As Pending box.
  15. Select Create Target Group.
  16. Back on the load balancer configuration screen, select the default action for listeners and routing to use the target group created earlier.
  17. Click Create Load Balancer.
  18. Select View Load Balancer.
  19. Review the configuration tabs including Description, Listeners, Monitoring, and Integrated Services.
  20. When finished, select Actions and delete the network load balancer.
  21. Go to Target Groups in the left panel of the EC2 console, deregister the targets, and delete the target group by selecting the target groups and Delete in the Actions pull-down.

Written Lab 4.2: Use the Console to Enable Deletion Protection

  1. In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
  2. Select Load balancers in the navigation panel on the left.
  3. Click your configured load balancer.
  4. Click the Description tab and the Edit Attributes box.
  5. Select Enable for deletion protection on the attributes page and save the changes.
  6. Select Save.

Written Lab 4.3: Use the Console to Disable Deletion Protection

  1. In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
  2. Select Load Balancers in the navigation panel on the left.
  3. Click your configured load balancer.
  4. Click the Description tab and the Edit Attributes box.
  5. Clear the Enable box for deletion protection on the attributes page and save the changes.
  6. Click Save.

Written Lab 4.4: Enable Application-Based Stickiness

  1. In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
  2. Select Load Balancers in the navigation panel on the left.
  3. Click Target Groups.
  4. Select the target group you want to modify and open the details page.
  5. On the group details tab, go to the Attributes section and click the Edit icon.
  6. On the Edit Attributes configuration page, select Stickiness.
  7. For the sticky type, select Application-Based Cookie.
  8. Select a value of 1 second to 7 days for the stickiness duration.
  9. Enter the name of your application-based cookie. Remember that AWSALB, AWSALBAPP, and AWSALBTG are reserved by AWS and cannot be used.
  10. Save the changes.