Hello, I have a problem when create a new Stack with rancher. My infrastructure is a Host A (where runs rancher server), and Host B (where deploy the system - rancher stack).
I create a stack uploading a docker-compose.yml or copying in it with the options restart: always in order to auto start container after restart de host B. If host B start and do not has connection to Host A (where Rancher Server runs), containers never starts in host B
I checked that the container in /var/lib/docker/containers/my_container/hostconfig.json has RestartPolicy: {Name: ""}. I think this is wrong… It should be > RestartPolicy: {Name: "always"}.…
Also, when I upgrade the stack, Autostart option was selected with “always”, but I get the same result…
Is there any way to indicate in a stack of rancher that a container run always after restart the host, independenlty of the connection to the rancher server?
Thank you
The restarting of containers created by services is managed by the rancher/server, for various reasons like ensuring that the network agent and related services are up before the container is started.
Standalone one-off containers have options that directly set the docker restart policy.
Hello Vincent, so, in conclusion, I can’t use stack and set the restart policy to “always”.
The bad part is If I use standalone containers, I can’t deploy the stack created with the assigned tag to any host. This feature is very util.
Also, I can not upgrade standalone containers from UI like the upgrade option in stack services
Are there any other alternative?
Thank You
I have same problem… When server is not online and some hosts restarted… all is down So the “restart always” feature in rancher is not so useful…