VK Cloud logo

Managing load balancing rules

You can manage the load balancing rules of the selected load balancer: view, add, edit, and delete them.

Adding a rule

  1. Go to the VK Cloud management console.

  2. Select a project.

  3. Go to Cloud NetworksLoad balancers.

  4. Click the load balancer name.

  5. In the Balancer rules section, click Add rule.

  6. Specify the rule parameters:

    • Protocols and ports:

      • The load balancing protocol and port that will be used by the load balancer.
      • The assignment protocol and port.

      When you select the TCP load balancing protocol, two assignment protocols are available: TCP or PROXY. The Proxy protocol can be used if it is supported by the servers behind the load balancer.

    • Balancing method:

      • LEAST_CONNECTIONS: use the backend with the fewest established connections.
      • ROUND_ROBIN: iterate through all backends sequentially.
      • SOURCE_IP: pin a backend to handle traffic from a specific client IP address.
    • Allowed CIDR: IP addresses or subnet addresses from which connections to the load balancer are allowed. This parameter can be used to restrict access to the load balancer to trusted addresses only.

      If the parameter is not set, connections from any IP addresses are allowed (equivalent to CIDR 0.0.0.0/0).

    • Timeout parameters:

      • Client data: client inactivity timeout.
      • Member connect: timeout for establishing a connection to the backend.
      • Member data: backend inactivity timeout.
      • TCP inspect: timeout for waiting for additional TCP segments during content inspection.

      Timeout values are specified in milliseconds. The minimum value is 0, the maximum is 2073600000 (576 hours).

    • Send X-Forwarded-For header (only for HTTP and TERMINATED_HTTPS load balancing protocols): an option that enables sending the corresponding HTTP header to the backend. By default, the option is disabled.

    • Sticky sessions: this option provides long-lived sessions with the server while preserving data throughout the entire session.

      If the option is enabled, requests are distributed among servers using the selected load balancing method, but after the connection is established, the session is pinned to the selected server. All subsequent requests of this session will be sent to the same server regardless of the load balancing method. The session does not end until the user ends it or until the server becomes unavailable. In that case, requests will be sent to another server according to the balancer rules.

      Type field lets you configure how the session is identified:

      • APP-cookie: the session is identified by a cookie set in the application code. If you select this parameter, specify the cookie used to identify the session in the Cookie name field.
      • HTTP-cookie: the session is identified by a cookie that the load balancer creates during the connection to the server and attaches to the session.
      • Source IP: the client IP address is used to bind the session to the server. Use this type only if the client IP address does not change during the session.
    • Apply to the following instances: tools for selecting VM instances that will act as backends for the load balancer. You can add an instance either by selecting it from the list or by selecting a tag assigned to the instance.

    • Certificate (only for the TERMINATED_HTTPS protocol): the certificate that will be used by the load balancer to terminate the SSL connection.

      You can upload a new SSL certificate or select one that was uploaded earlier.

      1. Select Upload a new certificate from the drop-down list.

      2. Fill in the fields:

        • Certificate name: enter a name. Example: example-com-2024.
        • Certificate or certificate chain: upload the certificate file.
        • Private key: upload the private key file.
        • Password: upload the private key password file if it is encrypted.
  7. Click Next step.

  8. Fill in the backend health check parameters (healthcheck):

    • Method of checking: TCP or HTTP.
    • Interval: check interval in seconds.
    • Number of attempts: how many times to attempt the check before considering the backend unavailable.
    • Timeout: timeout in seconds after which the backend is considered not responding to the check.

    The following parameters are available only for the HTTP check type:

    • HTTP method: the method to use for the availability check.
    • Response status: the HTTP status upon receiving which the availability check will be considered successful.
    • Request path: the path to request for the availability check.
  9. Click Add.

Editing a rule

  1. Go to the VK Cloud management console.
  2. Select a project.
  3. Go to Cloud NetworksLoad balancers.
  4. Click the load balancer name.
  5. In the Balancer rules section, in the row with the required rule, click the pencil icon.
  6. Make changes and click Edit.

Deleting a rule

  1. Go to the VK Cloud management console.
  2. Select a project.
  3. Go to Cloud NetworksLoad balancers.
  4. Click the load balancer name.
  5. In the Balancer rules section, in the row with the required rule, click the trash can icon and confirm deletion.