官术网_书友最值得收藏!

Docker Swarm Networking and Reverse Proxy

The most compelling reason for most people to buy a computer for the home will be to link it to a nationwide communications network. We’re just in the beginning stages of what will be a truly remarkable breakthrough for most people - as remarkable as the telephone.
                                                                                                                             –Steve Jobs

Software-Defined Network (SDN) is a cornerstone of efficient cluster management. Without it, services distributed across the cluster would not be able to find each other.

Having proxies based on static configuration does not fit the world of highly dynamic scheduling. Services are created, updated, moved around the cluster, scaled and de-scaled, and so on. In such a setting, information changes all the time.

One approach we can take is to use a proxy as a central communication point and make all the services speak with each other through it. Such a setting would require us to monitor changes in the cluster continuously and update the proxy accordingly. To make our lives easier, a monitoring process would probably use one of the service registries to store the information and a templating solution that would update proxy configuration whenever a change in the registry is detected. As you can imagine, building such a system is anything but trivial.

Fortunately, Swarm comes with a brand new networking capability. In a nutshell, we can create networks and attach them to services. All services that belong to the same network can speak with each other using only the name of the service. It goes even further. If we scale a service, Swarm networking will perform round-robin load balancing and distribute the requests across all the instances. When even that is not enough, we have a new network called ingress with routing mesh that has all those and a few additional features.

Efficient usage of Swarm networking is not sufficient by itself. We still need a reverse proxy that will be a bridge between the external world and our services. Unless there are special requirements, the proxy does not need to perform load balancing (Swarm networking does that for us). However, it does need to evaluate request paths and forward requests to a destination service. Even in that case, Swarm networking helps a lot. Configuring reverse proxy becomes a relatively easy thing to do as long as we understand how networking works and can harness its full potential.

Let’s see the networking in practice.

主站蜘蛛池模板: 南投县| 志丹县| 巴林右旗| 台湾省| 博兴县| 昭觉县| 竹溪县| 磐石市| 丽江市| 吴江市| 松桃| 汕头市| 恭城| 黑龙江省| 化德县| 五原县| 台前县| 多伦县| 漠河县| 图们市| 泉州市| 曲松县| 卓资县| 乐平市| 绥宁县| 万安县| 凭祥市| 东安县| 塔河县| 平度市| 青河县| 思南县| 南康市| 宾阳县| 景东| 精河县| 虞城县| 巴青县| 任丘市| 收藏| 晋江市|