Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Load Balancer
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Load balancers
      • Create a load balancer
      • Create an internal network load balancer
      • Start a load balancer
      • Stop a load balancer
      • Delete a load balancer
      • Check target health statuses
      • Add a listener
      • Delete a listener
    • Target groups
      • Create a target group
      • Attach a target group to a load balancer
      • Detach a target group from a load balancer
      • Delete a target group
  • Concepts
    • Load balancer
    • Internal load balancer
    • Listener
    • Targets and groups
    • Resource health checks
    • Quotas and limits
  • Best practices for using the service
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • NetworkLoadBalancerService
      • TargetGroupService
      • OperationService
    • REST
      • Overview
      • NetworkLoadBalancer
        • Overview
        • addListener
        • attachTargetGroup
        • create
        • delete
        • detachTargetGroup
        • get
        • getTargetStates
        • list
        • listOperations
        • removeListener
        • start
        • stop
        • update
      • TargetGroup
        • Overview
        • addTargets
        • create
        • delete
        • get
        • list
        • listOperations
        • removeTargets
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
  1. Step-by-step instructions
  2. Load balancers
  3. Add a listener

Adding a listener to a load balancer

  • Examples
    • Adding a listener to an internal load balancer
Management console
CLI
API

To add a listener to a network load balancer:

  1. Open the Load Balancer section in the folder where you want to add a new listener to the load balancer.
  2. Click in the line of the load balancer to add a listener for.
  3. In the menu that opens, click Add listener.
  4. Enter a port for the listener.
  5. Click Add.

If you don't have the Yandex.Cloud command-line interface, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To add a listener to a load balancer:

  1. Get the list of load balancers:

    $ yc load-balancer network-load-balancer list
    +----------------------+--------------------+-------------+----------+----------------+------------------------+----------+
    |          ID          |        NAME        |  REGION ID  |   TYPE   | LISTENER COUNT | ATTACHED TARGET GROUPS |  STATUS  |
    +----------------------+--------------------+-------------+----------+----------------+------------------------+----------+
    | c58r8boim8qfkcqtuioj | test-load-balancer | ru-central1 | EXTERNAL |              0 |                        | INACTIVE |
    +----------------------+--------------------+-------------+----------+----------------+------------------------+----------+
    
  2. Add the listener by entering the name, port, and IP address version:

    $ yc load-balancer network-load-balancer add-listener c580id04kvumgn7ssfh1 \
         --listener name=test-listener,port=80,external-ip-version=ipv4
    .....done
    id: c58r8boim8qfkcqtuioj
    folder_id: aoerb349v3h4bupphtaf
    created_at: "2019-04-01T09:29:25Z"
    name: test-load-balancer
    region_id: ru-central1
    status: INACTIVE
    type: EXTERNAL
    listeners:
    - name: test-listener
      address: <listener IP address>
      port: "80"
      protocol: TCP
    

You can add a listener using the addListener API method.

Examples

Adding a listener to an internal load balancer

CLI

Run the command, indicating the listener name, port, and subnet ID:

$ yc load-balancer network-load-balancer add-listener b7rc2h753djb3a5dej1i \
--listener name=test-listener,port=80,internal-subnet-id=e9b81t3kjmi0auoi0vpj
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC