After an application is created in a Container Service 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.

Prerequisites

  • To reuse an existing SLB instance, see Limits.
  • The reused SLB instance must be in the same VPC as the application to which the SLB instance will be bound.

Scenario

EDAS allows you to create an SLB instance and reuse an existing SLB instance.

  • Create an SLB instance: Instead of purchasing a new SLB instance in the SLB console, you can directly purchase a new SLB instance in the EDAS console. This facilitates O&M and reduces O&M costs.
  • Reuse an existing SLB: If you have purchased an SLB instance, you can use this existing SLB instance when configuring a listener.

Bind a new SLB instance

  1. In the left-side navigation pane, choose Resources > Clusters. On the Cluster Details page, click the application name in Applications.
    You can also choose Application Management > Applications from the left-side navigation pane, and then click the name of the Container Service Kubernetes application on the Applications page.
  2. In the Application Details section of the Application Overview page, click Add button on the right side of SLB (Internet).
    Note If you have configured an SLB instance, the IP address and port number of the SLB instance are displayed. You can click Modify to go to the configuration page and modify the information of the SLB instance. You can also click Unbind to unbind the SLB instance.
  3. In the SLB (Internet) dialog box, set SLB parameters.
    1. In the Select SLB drop-down list, select New SLB.

      EDAS automatically purchases a new SLB instance for your application. The information of the SLB instance is displayed at the bottom.

      You can click View Price to view the price of the SLB instance.

    2. Configure a listener.
      • TCP:
        • SLB Port (Application Name): This is the frontend port of the public SLB instance, which can be used to access the application. Value range: 1 - 65535.
        • Container Port (Target Port): This is the port that the process listens to. The port is typically defined by the application. For example, a web application uses port 8080 by default.
      • HTTPS:
        • HTTPS Port (Application Name): This is the frontend port of the public SLB instance, which can be used to access the application. Value range: 1 - 65535.
        • SSL Certificate: This is an SSL certificate. You can select an uploaded SSL certificate from the drop-down list.
        • Container Port (Target Port): This is the port that the process listens to. The port is typically defined by the application. For example, a web application uses port 8080 by default.
      Note Multiple listeners are supported. You can click + Add New Listeners to configure multiple listeners.
    3. Click OK.

Bind a reused SLB instance

The procedure for binding a reused SLB instance is the same as that for binding a new SLB instance, which is different only when an SLB instance is selected. For more information, see Bind a new SLB instance. When selecting an SLB instance, select the SLB instance that you want to reuse.

SLB - Reuse an SLB instance

After an SLB instance is selected, EDAS automatically displays the existing listeners of this SLB instance in the lower part of the page.

Note When you configure a new listener, you cannot configure a port number and container port that have been listened to for the SLB instance.

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.

QR code of DingTalk query group for Kubernetes users