I’d like to be able to do a rolling update, and I have sorta accomplished that by adding stop_grace_period:
So far so good - The droner runner container receives the shutdown signal, stops picking up new jobs and exits once its current are done. Meanwhile a new updated container becomes available and starts picking up new jobs.
However, while this works fine for most of our stuff, but a few instances we only want one running at a time.
However, docker swarm seems to ignore it.
I will still have two instances running on the same node during a rolling update. I get how max replicas per node might not do the job, but do I also misunderstand how stop-first works?
Stop-first is available for the compose file version 3.4 or later, and already is the default setting.
The placement constraint is not really meaningful with a single replica.
Can you rephrase it and explain what you want to achieve? I don’t understand how and why you change labels and it’s missing how you even run your containers.