Use CLB instances to access EDAS applications in Kubernetes clusters
Enterprise Distributed Application Service (EDAS) supports managed applications deployed in Kubernetes clusters. EDAS builds images for the applications and deploys them to Kubernetes clusters, simplifying application management. To route external or internal traffic to your application replicas, you can use Classic Load Balancer (CLB) instances that distribute traffic across your container replicas and automatically adjust as you scale the application in or out.
Background information
The Cloud Controller Manager (CCM) in an Alibaba Cloud Kubernetes cluster connects your application's container replicas to a CLB instance as backend servers. When you scale the application, CCM automatically adds or removes replicas from the CLB instance.
EDAS provides two ways to expose applications through CLB:
Create a CLB instance -- EDAS purchases and manages the instance automatically. Bind it on the Application Overview page.
Reuse an existing CLB instance -- Use a CLB instance that you created in the SLB console. Configure a listener port on the Application Overview page to expose your application without affecting existing listeners. For details, see Reuse a CLB instance.
Prerequisites
Before you begin, make sure that you have:
A Kubernetes cluster imported to the EDAS console with a deployed application, using one of the following methods:
Limits
Do not modify listeners or certificates in the SLB console for CLB instances purchased by EDAS. Your changes may be overwritten by EDAS configurations, making your applications inaccessible.
To reuse a CLB instance for an application in a Kubernetes cluster, the CLB instance and the cluster must be in the same virtual private cloud (VPC).
For CLB quotas and constraints, see CLB limits.
After you expose an EDAS application using an SLB instance, inner nodes in the Kubernetes cluster may not be able to access the EDAS application through the SLB endpoint. For more information, see Access to the SLB endpoint exposed by a LoadBalancer service fails in a Kubernetes cluster.
Create a CLB instance for an application
Bind one or more CLB instances to your application's backend replicas for load-balanced access. EDAS supports several CLB binding strategies:
| Strategy | Use case |
|---|---|
| One CLB instance to multiple replicas | Distribute traffic across all replicas of a single application |
| Multiple CLB instances to different ports | Expose different services of the same application on separate CLB instances, including mixed instance types |
| Multiple CLB instances to the same replicas | Share the traffic load beyond the capacity of a single CLB instance |
EDAS also supports combining Internet-facing and internal-facing CLB instances for the same Kubernetes cluster. Use Internet-facing instances to serve web traffic over the public network, and internal-facing instances for backend services that only need private network access.


Procedure
Log on to the EDAS console. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select a region. In the upper part of the page, select a microservice namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list, and click the name of your application.
On the Application Overview page, in the Access configuration section, click the
icon next to SLB (Public Network) or SLB (Private Network). For parameter details, see Bind CLB instances.Note If a CLB instance is already bound to your application, its IP address and port are displayed. Click the
icon to modify the configuration, or click the delete icon to unbind the CLB instance.In the SLB (Public Network) or SLB (Private Network) dialog box, configure the CLB instance parameters.
Click OK. Wait for the application to start running.
(Optional) If traffic exceeds the capacity of a single CLB instance, repeat steps 2-4 to bind additional CLB instances.
Verify the result
After the application starts running, check the Access configuration section on the Application Overview page. The bound CLB instance IP address and port are displayed next to SLB (Public Network) or SLB (Private Network). Send a request to the displayed IP address and port to confirm that traffic reaches your application.
Reuse an existing CLB instance
Share a single CLB instance across multiple applications by assigning different listener ports. This reduces costs and the total number of CLB instances to manage.

Before you reuse a CLB instance, verify the following:
At least one running CLB instance exists. To create one, see Create and manage a CLB instance.
The CLB instance type matches your access needs: Internet-facing for public access, internal-facing for private network access.
The CLB instance and the Kubernetes cluster are in the same region.
If the CLB instance and the Kubernetes cluster are VPC-connected, they are in the same VPC.
When multiple applications share a CLB instance, assign unique listener ports to each application to avoid port conflicts. Verify that all teams with access to the shared CLB instance follow the same port allocation conventions.
Procedure
Log on to the EDAS console. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select a region. In the upper part of the page, select a microservice namespace. Select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list, and click the name of your application.
On the Application Overview page, in the Access configuration section, click the
icon next to SLB (Public Network) or SLB (Private Network). For parameter details, see Reuse a CLB instance.Note If a CLB instance is already bound to your application, its IP address and port are displayed. Click the
icon to modify the configuration, or click the delete icon to unbind the CLB instance.In the SLB (Public Network) or SLB (Private Network) dialog box, configure the CLB instance parameters. Assign a unique listener port and program port for each application that shares this CLB instance.
Click OK. Wait for the application to start running.
(Optional) To bind additional CLB instances, repeat steps 2-4.
Modify CLB instance settings
After binding a CLB instance, change its instance type, scheduling algorithm, or listener port from the EDAS console. For binding instructions, see Bind CLB instances. For default configurations of a new CLB instance and listeners, see Default CLB instance and listener settings.
Do not modify configurations in the SLB console for CLB instances purchased by EDAS. Changes from multiple consoles can cause data inconsistency, or EDAS may overwrite your changes. For CLB instances that you created outside of EDAS, modify configurations in the SLB console as needed.
Procedure
In the left-side navigation pane, click Applications. In the top navigation bar, select a region. On the Applications page, select a namespace, and select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Click the name of your application.
On the Application Overview page, in the Access configuration section, click the
icon next to SLB (Public Network) or SLB (Private Network).In the SLB (Public Network) or SLB (Private Network) dialog box, update the parameters. For example, change the instance type to Small I (slb.s1.small), the scheduling algorithm to round-robin (RR), and map HTTPS listener port 443 to container port 18081.

Click OK. Wait for the application to start running.
Forwarding rules
Create an Ingress for your EDAS application to distribute traffic by domain name and URL path at Layer 7. Ingresses do not require separate CLB instances. For setup instructions, see Create an NGINX Ingress for an application.

Health checks
Configure lifecycle hooks and probes for your EDAS applications in Kubernetes instead of relying on CLB listener health checks. Hooks and probes let EDAS dynamically update backend servers based on each replica's health status, and support a broader range of health check methods.
For configuration details, see Configure application lifecycle hooks and probes.
Do not modify health check configurations in the SLB console for CLB instances purchased by EDAS. For other CLB instances, modify health check settings in the SLB console as needed.

Default CLB instance and listener settings
EDAS applies the following defaults when creating a CLB instance:
| Setting | Default value |
| Bandwidth | 5120 Mbit/s |
| IP version | IPv4 |
| Deletion protection | Enabled |
| Configuration modification protection | Enabled |
| Session persistence | Off (timeout: 0 seconds) |
| Health check (TCP listeners) | On |
| Health check (HTTPS listeners) | Off |
| Health check protocol | TCP |
| Healthy threshold | 3 consecutive successful checks |
| Unhealthy threshold | 3 consecutive failed checks |
| Health check interval | 2 seconds |
| Health check response timeout (TCP) | 5 seconds |
| Healthy status code | HTTP 2xx |
| Access control | Off |
| TCP listener connection timeout | 900 seconds |
| HTTPS listener connection timeout | 15 seconds |
| HTTPS listener HTTP/2 | Enabled |
