Rancher server and client in the same host

Is possible to run Rancher Server and Rancher client in the same host (but in different container)?
Is an allowed practice ?

It’s allowed but not a recommended practice. If you do so, please see these instructions when adding the host.


Thank you for the answer Denise :smile:

another little question:

if a remote rancher server (hosted in Italy for example) lose connectivity to the hosts (on USA) for little time (minutes) or big time (hours), how the hosts will be affected?

will they lose the functionality ? or gets broken? (I think not, but just to be sure)

If the server loses connectivity to a host it will assume the host has failed and spin up new containers for services in order to meet their desired scales.

If that host is not actually dead, but still running and not able to reach the server for some reason, the containers on it will continue to run and serve traffic (assuming the network otherwise works…). When connectivity is restored your services may have more containers than the desired scale (since one we thought was gone showed back up) and can be scaled back down.

hi Vincent, thank you for your answer, really good and complete one.
I clearly understand that situation, but how the server will act it itself lose connectivity with all the hosts ?(assuming that the server is using wan to connect to hosts)

It doesn’t really matter for this discussion but FYI the hosts (agent containers) open a connection to the server, not the other way around. This way the hosts don’t have be publicly accessible on the internet.

If the server loses internet connectivity, all the long-lived connections from the agents->server will drop and all the hosts will go into “disconnected” state (if you could see the server…). At this point there is nowhere for it to schedule replacement containers since there are no active hosts, so it will not really be able to do anything until hosts are able to connect back in and are in active states again.

I’m not positive but I think if you did something like yank the ethernet cable to the server, wait a bit for the hosts to all show disconnected, and then plug it back in, all the agents would reconnect within a small enough window that the server would not have gotten to rescheduling any of the containers onto the subset of hosts that happen to show back up first (@alena / @sonchang ?), so the net result would be as if nothing happened.

We don’t schedule service reconcile (containers redeployment) on host.disconnect. So service itself won’t kill the containers on disconnected host. And if it comes back fast enough, we should be good.

Nice, i think this is the first thing that scary someone new approaching to rancher;
but @alena, what happens if it doesn’t come back fast?
Will the host continue to work and run even without the server?

Thanks to all for the answers :smile:

A disconnected host will continue to do what it was doing indefinitely. You will of course not be able to manage it from Rancher while it’s disconnected.

Can you update that link? It appears to be down - possibly moved somewhere else