Service discovery and Server Load Balancer mainly solves the issue of communication reliability. To guarantee the reliability, Container Service introduces the Server Load Balancer mechanism. Communication is divided into two types: communication that exposes services and communication between internal services. See the following scenarios for different solutions.
We recommend that you use simple routing service for simple Layer-7 protocol Server Load Balancer and web service reverse proxy. For more information, see Simple routing - supports HTTP and HTTPS, Simple routing - configure domain names, and Simple routing - change HTTP to HTTPS.
Server Load Balancer distributes the loads evenly to containers with the same functions in Layer-4 protocol Server Load Balancer and services of non-container clusters access the services of containers in container clusters when a traditional architecture is migrated to a container architecture. We recommend that you use Server Load Balancer routing.
Services in the same cluster need to discover and communicate with each other, and need the Server Load Balancer capabilities. We recommend that you use Routing and Server Load Balancer between services in a cluster.
Services in the same cluster need to discover and communicate with each other, but do not need the Server Load Balancer capabilities. We recommend that you use Service discovery between containers.
Server Load Balancer and service discovery have high customization requirements, such as the support for extensive domain names, custom error page, record accessing logs, selection of backend services based on URL parameter values, and custom HAProxy configuration files. We recommend that you use custom routing. For more information, see Custom routing - user guide and Custom routing - simple sample.