All Products
Search
Document Center

:Add an SLB instance to an application in a Kubernetes cluster

Last Updated:Feb 24, 2025

After an application is created in a Container Service Kubernetes cluster or user-created Kubernetes cluster in Enterprise Distributed Application Service (EDAS), you can add a public or private Server Load Balancer (SLB) instance to the application so that the application can be accessed through the Internet or a private network. This topic describes how to add a public SLB instance to an application in a Container Service Kubernetes cluster.

Background

The differences for binding SLB instances to applications in Container Service Kubernetes clusters and user-created Kubernetes clusters are as follows:

  • In a user-created Kubernetes cluster: Purchase a new SLB instance for each application. The application exclusively uses the SLB instance.
  • In a Container Service Kubernetes cluster: Purchase a new SLB instance or reuse an SLB instance for each application. When a newly purchased SLB instance is used, the application exclusively uses the instance.
Note When a reused SLB instance is used, you must follow certain constraints and special operations. For more information, see Reuse SLB instances for applications in Container Service Kubernetes clusters.

Prerequisites

Create a CLB instance in the SLB console.
Important The created SLB instance must be in the same VPC as the application to which the SLB instance will be bound.

Bind an SLB instance to an application

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select a region. In the upper part of the Applications page, select a microservices namespace from the Microservices Namespace drop-down list. Then, click the name of the application that you want to manage.

  3. On the Application Overview page, click the Plus icon icon next to SLB (Public Network) in the Access configuration section.
    Note If you have bound a CLB instance to your application, the IP address and port number of the CLB instance are displayed. You can click the Editicon to modify the configuration or click theicon to unbind the CLB instance from your application.
  4. In the Add Public SLB Configuration Confirmation dialog box, set the SLB parameters and then click OK.

Verify the result

In the address bar of your browser, enter <IP address of the SLB instance>:<port number of the SLB instance>, for example, 115.28.XX.XX:80, and then press Enter to go to the homepage of the corresponding application.

If the IP address and port number do not appear on the right side of the SLB instance, the binding failed. Go to the Change Logs page to view the change details, and troubleshoot the failure based on the change logs.

Feedback

If you have any questions about using Container Service Kubernetes clusters, you are welcome to scan the following QR code to join the DingTalk group for feedback.