I’m using Docker (v. 19.03.5, CentOS 3.10.0-1062.9.1.el7.x86_64) in Swarm mode and I’m using the following deploy params in stack yml:
deploy: replicas: 2 update_config: delay: 25s
But Swarm’s load balancer almost instantly starts to serve (load balance) requests to a newly updated replica. But what I need is that Swarm (or LB) give some time for the service to warm up (it’s a SpringBoot backend service). The idea is to not interrupt serving requests from frontends, i.e. first of all load balance to the second replica (with old image), then roll update first replica, give it a time to warm up, then switch ingress requests to the newly updated replica, then update second replica, give it a time to warm up and only then include it to a list of services that are load balanced.