Swarm clusters support Layer-7 (
aliyun.routing) and Layer-4 (
aliyun.lb) routing. Swarm mode clusters also support these two routing modes and use the same syntax, as shown in the following orchestration template.
aliyun.routing.port_80: web: Forward the web subdomain to port 80 of the Nginx service. This mode does not require to expose the container port to the host. If only this mode is enabled, the
portssection can be omitted from the preceding template.
aliyun.lb.port_80: tcp://slbtest:8080: Bind port 8080 of the Server Load Balancer instance slbtest to port 80 of the Nginx service. Swarm clusters require you to manually bind a port to the slbtest backend, while this is not required for swarm mode clusters. Container Service automatically modifies the Server Load Balancer backend based on your exposed port. In swarm mode, different services of the same cluster can share a Server Load Balancer instance.