K
K
kiranananda2019-02-21 22:09:14
Docker
kiranananda, 2019-02-21 22:09:14

Docker swarm architectural questions?

Hello!
There is a docker swarm. It has 3 rails. Raised 3 managers for fault tolerance. Inside, nginx->php is currently running. And other services for this business.
I need connections to the combat site through one piece of iron, and development was carried out through another. The port is 80 everywhere. In theory, nginx should be raised both for combat and on a typewriter for developers, so that when development is underway, they can immediately have access to the downloaded files. Well, ideally have them isolated from each other. But swarm, opens a port for the service on all the pieces of iron in the cluster. And it turns out I can't run 2 nginx in the same cluster. There is also a solution to use the key mode = host. But in this case, it will not be possible to make a beautiful restart of the service, so that customers would not notice this. This is implemented using order: start-first (the docker swears that there is no node available, well, this is understandable). That is, a new service starts, and the old one, meanwhile, is servicing the connected clients ...
I wanted to get into iptables and solve the whole thing through dnat, but as I understood that it’s impossible to set ip addresses either, so this idea fell off (.
Raise a proxy for this and resolve ports for them? Will this not create an additional heavy load on the network? Maybe there are some other solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Askhat Bikmetov, 2019-02-21
@kiranananda

> In theory, nginx should be raised both for combat and for developers
. Bad idea. Your cluster should have one service listening for connections on port 80, whether it's Nginx or whatever. To solve your problem and route requests, you can use different ports, which is completely amateurish, or match requests in Nginx:

example.com
dev.example.com // как я понимаю слушает только 192.168...

или

example.com/
example.com/dev // imho не удобно

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question