In correlation with the end of life (EOL) for MKE 3.5.x, maintenance of this documentation set was discontinued as of 2023-NOV-22. Click here for the latest MKE 3.x version documentation.
Deploy services in separate service clusters¶
With your service clusters configured, you can now deploy services, routing
to them with your new proxy services using the service_cluster label.
Create two example services:
docker service create --name demoeast \ --network eastnet \ --label com.docker.lb.hosts=demo.A \ --label com.docker.lb.port=8000 \ --label com.docker.lb.service_cluster=east \ training/whoami:latest docker service create --name demowest \ --network westnet \ --label com.docker.lb.hosts=demo.B \ --label com.docker.lb.port=8000 \ --label com.docker.lb.service_cluster=west \ training/whoami:latest
Ping your
whoamiservice on themke-node-0proxy server:curl -H "Host: demo.A" http://<mke-node-0 public IP>
The response contains the container ID of the
whoamicontainer declared by thedemoeastservice.The same
curlcommand onmke-node-1fails because that Interlock proxy only routes traffic to services with theservice_cluster=westlabel, which are connected to thewestnetDocker network that you listed in the configuration for that service cluster.Ping your
whoamiservice on themke-node-1proxy server:curl -H "Host: demo.B" http://<mke-node-1 public IP>
The service routed by
Host: demo.Bis only reachable through the Interlock proxy mapped to port 80 onmke-node-1.