Let's say I have the following setup:
swarm-00: Manager swarm-01: Worker swarm-02: Worker
Now I start a new
docker service create --replicas 2 --health-cmd /check.sh --restart-max-attempts 2 nginx
The service has started
NAME IMAGE NODE DESIRED STATE LAST STATE nginx.1.1p1vev3fq5zm0mi8g0as41w35 alpine swarm01 Running Running 3 minutes nginx.1.2s2shjer934jijfr09oioe090 alpine swarm02 Running Running 2 minutes
Now let's say for some reason health check always fails on
Once it restarts and have maxed out the total retries of
2 (or even without exhausting the retries), I want it to completely avoid
swarm02 and try on other worker nodes instead. Acting like a dynamic constraint.
Is this possible?