Creating Application Load Balancer infrastructure through a wizard
Yandex Application Load Balancer enables distributing requests across backends of your network applications and terminating TLS encryption. Application Load Balancer runs at Layer 7 of the OSI model
This guide will help you deploy the Application Load Balancer infrastructure and set up traffic to the test application backend.
Below, you can see how to create an infrastructure using a wizard. You can also create all components one by one.
Getting started
- Log in or sign up to the management console
. If not signed up yet, navigate to the management console and follow the instructions. - On the Billing
page, make sure you have a billing account linked and it has theACTIVE
orTRIAL_ACTIVE
status. If you do not have a billing account yet, create one. - If you do not have a folder yet, create one. While creating a folder, you can also create a default virtual network with subnets in all availability zones.
Create a VM and launch a test web server on it
-
Create a virtual machine named
test-vm1
from the Ubuntu 24.04 public image in theru-central1-a
availability zone. -
If you have the Yandex Cloud command line interface installed, you can connect to the VM via OS Login:
yc compute ssh --name test-vm1
-
Start a test web server that will respond to requests at port
8080
:mkdir test-server; echo 'HELLO' > test-server/hello.txt; python3 -m http.server -d test-server 8080
-
Make sure the web server returns a list of folders in the
test-server
folder. Open the terminal on your computer and run this command:curl -v <VM_public_IP_address>:8080
Create Application Load Balancer infrastructure
- In the management console
, select the folder where you want to create a load balancer. - In the list of services, select Application Load Balancer.
- Click Create L7 load balancer and select Wizard.
Target group settings
Your application backends will be deployed on the VM instance of the target group. The target group will be connected to the load balancer so that requests might be sent to the backend endpoints of your application.
In this example, we will assume there is only one VM in the target group.
- Enter the target group name:
test-target-group
. - Select the VM named
test-vm1
. - Leave all other settings unchanged and click Create and continue.
Backend group settings
Backend groups contain settings for traffic balancing and target resource health check. The wizard automatically creates one backend and one health check group. It will also select the group you created at the previous step as target group.
-
Enter the backend group name:
test-backend-group
. -
To open backend and health check group settings, toggle Advanced settings on.
-
Enter the backend name:
backend-1
. -
Configure health check settings:
- Interval:
3
. - Healthy threshold:
2
.
- Interval:
-
Leave all other settings unchanged and click Create and continue.
HTTP router settings
HTTP routers define the rules for routing requests sent to backends and allow you to modify requests directly in the balancer. The wizard will automatically create a virtual host and routing rule. It will also select the group you created at the previous step as backend group.
- Enter the router name:
test-http-router
. - Toggle Advanced settings on.
- Under Virtual hosts, enter:
- Host name:
test-virtual-host
. - Route name:
test-route
.
- Host name:
- Leave all other settings unchanged and click Create and continue.
L7 load balancer settings
A load balancer receives requests and distributes them across target group VMs according to the rules specified in the HTTP router. Load balancers use listeners to receive traffic. The wizard will create a listener automatically. It will also select the router you created at the previous step as HTTP router.
As an example, let's create a balancer with a node in the same subnet and same availability zone.
-
Enter the load balancer name:
test-load-balancer
. -
Under Network settings, select the network whose subnet will host the load balancer node.
-
Toggle Advanced settings on.
-
Under Allocation, select a subnet in a single availability zone and enable traffic in this subnet.
Remove all other availability zones by clicking
in the relevant row. -
Under Listeners, enter the listener name:
test-listener
. -
Leave all other settings unchanged and click Create.
Test the load balancer
In the terminal, run the following command:
curl -v <load_balancer_public_IP_address>:80
The response must return the 200
HTTP status code and an HTML-formatted list of folders from the test VM folder.
After that, you can add other VMs to the target group, create new backends for your application, and build routes to the application endpoints.
How to delete the resources you created
To stop paying for the resources created, delete them in the following order: