Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Application Load Balancer
  • Getting started
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • L7 load balancer logs
  • Release notes

In this article:

  • Getting started
  • Create a VM and launch a test web server on it
  • Create a target group
  • Create a backend group
  • Create an HTTP router
  • Create an L7 load balancer
  • Test the load balancer
  • How to delete the resources you created

Getting started with Yandex Application Load Balancer

Written by
Yandex Cloud
Updated at April 22, 2025
  • Getting started
  • Create a VM and launch a test web server on it
  • Create a target group
  • Create a backend group
  • Create an HTTP router
  • Create an L7 load balancer
  • Test the load balancer
  • How to delete the resources you created

Yandex Application Load Balancer enables distributing requests across backends of your network applications and terminating TLS encryption. Application Load Balancer runs on Layer 7 of the OSI model using HTTP and HTTPS.

This guide will help you deploy the Application Load Balancer infrastructure and set up traffic to the test application backend.

The Yandex Application Load Balancer infrastructure includes:

  • Target group.
  • Backend group.
  • HTTP router.
  • L7 load balancer.

Below is a description of how to create each component individually. You can also use the wizard to create all components on the same page.

Getting startedGetting started

  1. Log in or sign up to the management console. If not signed up yet, navigate to the management console and follow the on-screen instructions.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and its status is ACTIVE or TRIAL_ACTIVE. If you do not have a billing account yet, create one.
  3. 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 itCreate a VM and launch a test web server on it

  1. Create the test-vm1 VM from the Ubuntu 24.04 public image in the ru-central1-a availability zone.

  2. Connect to your VM over SSH.

    If you have the Yandex Cloud CLI installed, you can connect to your VM via OS Login:

    yc compute ssh --name test-vm1
    
  3. Start a test web server listening on port 8080:

    mkdir test-server; echo 'HELLO' > test-server/hello.txt; python3 -m http.server -d test-server 8080
    
  4. Make sure your web server returns a list of subdirectories in the test-server directory. Open the terminal on your computer and run this command:

    curl --verbose <VM_public_IP_address>:8080
    

Create a target groupCreate a target group

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.

Management console
CLI
  1. In the management console, select the folder to create your target group in.
  2. In the list of services, select Application Load Balancer.
  3. In the left-hand menu, select Target groups.
  4. Click Create target group.
  5. Enter the target group name: test-target-group.
  6. Select the VM named test-vm1.
  7. Click Create.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

Run this command:

yc alb target-group create test-target-group \
  --target subnet-name=<VM_subnet_name>,ip-address=<VM_internal_IP_address>

Create a backend groupCreate a backend group

Backend groups contain settings for traffic balancing and target resource health check. Create a group and add one backend to it.

Management console
CLI
  1. In the left-hand menu, select Backend groups.
  2. Click Create backend group.
  3. Enter the backend group name: test-backend-group.
  4. Under Backends, click Add. Specify the backend settings:
    1. Enter the backend name: backend-1.
    2. In the Target group list, select test-target-group.
    3. Specify Port: 8080.
  5. Expand the Protocol settings field and set the parameters:
    1. Select the HTTP type.
  6. Click Add health check and set up the check:
    1. Timeout, s: 1.
    2. Interval: 3.
    3. Healthy threshold: 2.
    4. Unhealthy threshold: 2.
    5. Type: HTTP.
    6. Path: /.
  7. Click Create.
  1. Create a backend group:

    yc alb backend-group create test-backend-group
    
  2. Create a backend and health check:

    yc alb backend-group add-http-backend \
      --backend-group-name test-backend-group \
      --name backend-1 \
      --port 8080 \
      --target-group-name test-target-group \
      --target-group-id <target_group_ID> \
      --http-healthcheck healthy-threshold=2,unhealthy-threshold=2,timeout=1s,interval=3s,path=/
    

Create an HTTP routerCreate an HTTP router

HTTP routers define the rules for routing requests sent to backends and allow you to modify requests directly in the balancer.

Management console
CLI
  1. In the left-hand menu, select HTTP routers.
  2. Click Create HTTP router.
  3. Enter the router name: test-http-router.
  4. Under Virtual hosts, click Add virtual host.
  5. Enter the host name: test-virtual-host.
  6. Click Add route.
  7. Enter test-route as Name.
  8. In the Path field, select Starts with and specify the / path.
  9. In the Action field, keep Routing.
  10. In the Backend group list, select test-backend-group.
  11. Leave all other settings unchanged and click Create.
  1. Create an HTTP router:

    yc alb http-router create test-http-router
    
  2. Create a virtual host:

    yc alb virtual-host create test-virtual-host --http-router-name test-http-router
    
  3. Add a route:

    yc alb virtual-host append-http-route test-route \
      --http-router-name test-http-router \
      --prefix-path-match / \
      --backend-group-name test-backend-group \
      --virtual-host-name test-virtual-host
    

Create an L7 load balancerCreate an L7 load balancer

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.

As an example, let's create a balancer with a node in the same subnet and same availability zone.

Management console
CLI
  1. In the left-hand menu, select Load balancers.

  2. Click Create L7 load balancer.

  3. Enter the load balancer name: test-load-balancer.

  4. Under Network settings, select the network whose subnet will host the load balancer node.

  5. Under Allocation, select a subnet in one availability zone and enable incoming traffic in this subnet.

    Remove the other availability zones by clicking in the relevant row.

  6. Under Listeners, click Add listener. Set the listener settings:

    1. Enter the listener name: test-listener.
    2. Under Public IP address, enable traffic.
    3. Set the port to 80.
    4. Select the Automatically type.
  7. In the HTTP router field, select test-http-router.

  8. Click Create.

  1. Create a load balancer with a node in the same subnet:

    yc alb load-balancer create test-load-balancer \
      --network-name <network_name> \
      --location subnet-name=<subnet_name_in_ru-central1-a_zone>,zone=ru-central1-a
    
  2. Add a listener:

    yc alb load-balancer add-listener test-load-balancer \
      --listener-name test-listener \
      --http-router-id <HTTP_router_ID> \
      --external-ipv4-endpoint port=80
    

Test the load balancerTest the load balancer

In the terminal, run the following command:

curl --verbose <load_balancer_public_IP_address>:80

The response must return the HTTP status code 200 and an HTML 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 createdHow to delete the resources you created

To stop paying for the resources you created, delete them in the following order:

Management console
  1. Delete the test-load-balancer L7 load balancer.
  2. Delete the test-http-router HTTP router.
  3. Delete the test-backend-group backend group.
  4. Delete the test-target-group target group.

Was the article helpful?

Next
All guides
© 2025 Direct Cursus Technology L.L.C.