Exercises – Load Balancing – ANS-C01 Study Guide
Exercises
- Read the application load balancer user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html.
- Read the network load balancer user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html.
- Read the gateway load balancer user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/introduction.html.
- Read the target groups user guide: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html.
- Read the AWS autoscaling documentation: https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-a-scaling-plan.html.
- Read the AWS cross-zone load balancing documentation: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-subnets.html.
- Read the AWS autoscaling documentation: https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html.
- Read the Kubernetes controller documentation on GitHub: https://github.com/kubernetes/controller-manager.
Written Labs
Written Lab 4.1: Create a Network Load Balancer
- In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
- Select Load Balancers in the navigation panel on the left.
- Select Create Load Balancer.
- Click the Create Load Balancer box.
- Select Create Network Load Balancer.
- In Basic Configuration, name your load balancer and select Internal IPv4.
- In Network Mapping, select your VPC to place the load balancer into where the EC2 web servers reside.
- In Mappings, select one availability zone that is internal.
- In the Listeners And Routing box, leave the listener protocol at the default and select Create A Target Group.
- In Target Group Basic configuration, leave the target type as Instances.
- Name the target group and leave the protocol and port at TCP port 80 (HTTP).
- Place the target group in the same VPC as the network load balancer and where the EC2 web servers reside.
- Leave the health checks as TCP.
- Select one or more EC2 instances and click the Include As Pending box.
- Select Create Target Group.
- Back on the load balancer configuration screen, select the default action for listeners and routing to use the target group created earlier.
- Click Create Load Balancer.
- Select View Load Balancer.
- Review the configuration tabs including Description, Listeners, Monitoring, and Integrated Services.
- When finished, select Actions and delete the network load balancer.
- 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
- In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
- Select Load balancers in the navigation panel on the left.
- Click your configured load balancer.
- Click the Description tab and the Edit Attributes box.
- Select Enable for deletion protection on the attributes page and save the changes.
- Select Save.
Written Lab 4.3: Use the Console to Disable Deletion Protection
- In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
- Select Load Balancers in the navigation panel on the left.
- Click your configured load balancer.
- Click the Description tab and the Edit Attributes box.
- Clear the Enable box for deletion protection on the attributes page and save the changes.
- Click Save.
Written Lab 4.4: Enable Application-Based Stickiness
- In the AWS web console, go to the EC2 service page at https://console.aws.amazon.com/ec2.
- Select Load Balancers in the navigation panel on the left.
- Click Target Groups.
- Select the target group you want to modify and open the details page.
- On the group details tab, go to the Attributes section and click the Edit icon.
- On the Edit Attributes configuration page, select Stickiness.
- For the sticky type, select Application-Based Cookie.
- Select a value of 1 second to 7 days for the stickiness duration.
- Enter the name of your application-based cookie. Remember that AWSALB, AWSALBAPP, and AWSALBTG are reserved by AWS and cannot be used.
- Save the changes.