Target Groups#

One or more target groups must be created for the load balancer to work. Each target group includes one or more targets among which requests are distributed. The target is identified by a combination of instance ID and port number.

Traffic is routed to the target group specified in the traffic listener. To balance different request types, you can create multiple listeners and corresponding target groups.

The same target group can be used by several listeners, but only by one load balancer. In other words, all listeners using a particular target group must belong to the same load balancer.

Note

In total, you can create up to 500 target groups in each project. Each target group can include up to 100 targets.

Create target group#

Note

Only instances in the Running state can be added to the target group. They must be in the same VPC as the load balancer.

To create a target group:

  1. Go to the Load Balancing section Target Groups and click Create.

  2. Specify target group parameters:

    • Name – Target group name. The name must not be longer than 32 characters, can only contain Latin letters, numbers and hyphens, and must not start or end with a hyphen.

    • Protocol – Protocol used to transmit TCP or UDP traffic. It must be the same as the protocol specified in the listener.

    • Port – The default port for receiving traffic. It will be assigned to the target if no other port is specified.

    • VPC – VPC in which targets are located.

    To go to the next step, click Next.

  3. Set the health check settings.

    • Healthy threshold – The number of successful health checks before the resource is considered available.

    • Unhealthy threshold – The number of failed health checks before the resource is considered unavailable. This parameter is automatically set equal to the healthy threshold.

    • Interval – Period between health checks of a target.

    • Timeout – The time, after which the check is considered failed if there is no response. This value is for reference only and cannot be changed.

    To go to the next step, click Next.

  4. Register instances in a target group.

    Note

    You may skip this step and register targets later.

    • Select instances from the drop-down list.

    • Change the default port if necessary. You can specify multiple ports separated by commas. In this case, a separate target with the selected port will be created for each selected instance.

    • Click Add to include instances with the specified ports in the target group.

    • Check the list of resources to be added. If necessary, you can right away add more targets by repeating the steps above, or delete unnecessary ones by clicking Delete targets.

    To go to the next step, click Next.

  5. Double-check all the set parameters and targets and click Create.

Register targets#

If necessary, you can add more targets to an existing target group, for example, when their performance becomes insufficient or some target becomes unavailable.

  1. Go to the Load Balancing section Target Groups.

  2. Select the target group from the list and click Register resources. Alternatively, click the target group name to go to the group page, open the Targets tab, and click Register targets.

  3. Add instances to the target group.

    • Select instances from the drop-down list.

    • Change the default port if necessary. You can specify multiple ports separated by commas. In this case, a separate target with the selected port will be created for each selected instance.

    • Click Add to include instances with the specified ports in the target group.

    • Check the list of resources to be added. If necessary, you can right away add more targets by repeating the steps above, or delete unnecessary ones by clicking Delete.

  4. Click Register to register targets.

Change settings to check health#

  1. Go to the Load Balancing section Target Groups.

  2. Select the target group from the list and click Edit health check settings. Alternatively, click the target group name to go to the group page, open the Health check tab, and click Edit health check settings.

  3. Edit the health check settings:

    • Change healthy threshold if necessary. The unhealthy threshold will be automatically changed and set equal to the healthy threshold.

    • Change the interval between checks if necessary.

  4. Click Modify to apply the new settings.

Deregister targets#

To exclude targets from the group:

  1. Go to the Load Balancing section Target Groups.

  2. Click the target group name to go to the group page and open the Targets tab.

  3. Select from the table the targets you want to deregister, and click Deregister.

    Attention

    The operation is performed without additional confirmation. If necessary, you can easily again register resources, which you deregistered.

Create a balancer with an associated target group#

You can create a load balancer directly in the Target Groups section. It will be associated with the selected target group, so you won’t have to set parameters of this target group. This feature is available for groups only if they are not associated with any listener.

To create a balancer and associate it with a target group:

  1. Go to the Load Balancing section Target Groups.

  2. Select the target group from the resource table and click Create load balancer.

  3. A balancer creation wizard opens. It is similar to the standard wizard. Follow steps 2 and 3 to configure the basic settings and associate the balancer with a network.

  4. Add listeners as described in step 4. You don’t need to specify a target group to which the listener forwards traffic, since the selected target group is used for forwarding. If forwarding to other target groups is required, it can be set up after creating the balancer by adding listeners. To add other listeners, click Add.

  5. In the last step, check the configured load balancer parameters and click Create.

Add listener for a target group#

You can add a listener for the selected target group directly in the Target Groups section and avoid specifying its parameters. The listener adding procedure is slightly different depending on whether the target group is associated with a load balancer or not.

To add a listener:

  1. Go to the Load Balancing section Target Groups.

  2. Select the target group from the resource table and click Add listener.

  3. If the group is not associated with any load balancer, select a load balancer from the drop-down list. Set the port the listener will use to receive traffic.

  4. Click Add.

Delete target group#

Note

The target group can only be deleted if not used by any listener. Deleting a target group only deletes the group itself. Instances included in it as targets are not deleted.

To delete a target group:

  1. Go to the Load Balancing section Target Groups.

  2. Select the target group from the list and click Delete. Alternatively, click the target group name to go to the group page, open the Information tab, and click Delete.

  3. To confirm the action, click Delete.

Target group information#

The resource page displays data about the target group, its resources, along with their quantities and parameters, health check settings, and other useful information. To open the specific target group page, go to the Load balancing section Target groups and click its name in the resource table.

The Information tab shows general information about the group:

  • target group name;

  • type of targets included in it;

  • network load balancer to which the group refers;

  • protocol used to transmit traffic to the target group;

  • port to which traffic is transmitted;

  • VPC in which the target group is created;

  • number of targets in the group.

In addition, here you can delete the group.

The Instances tab displays data about the targets included in the group.

  • instance ID;

  • port at which traffic is received;

  • target status;

  • the reason why the target is in this status;

  • brief description of the reason.

In addition, here you can register additional resources or deregister existing resources.

In the Health Check tab, you can view the health check settings and change some of them:

  • protocol used for health check;

  • port used for health check;

  • healthy threshold;

  • unhealthy threshold;

  • interval between health checks;

  • waiting time for a response, after which the check is considered failed.