How can you automatically provision new machines when docker swarm detects there are not enough resources to schedule all services?
I use a setup with rancher and the docker swarm scheduler, and if there are not enough resources, the service creation fails:
exit status 1: Creating stresstest2_workerb1_1 Creating stresstest2_workerb2_1 no resources available to schedule container
I can poll for this status and call docker machine when needed, but rancher will not attempt to re-schedule the missing services. I wonder if there is a more integrated solution, maybe a hook within docker swarm that can be used to dynamically call docker-machine to create or remove machines.
I'm currently deciding between Rancher with Docker 1.11 + Docker Swarm or Docker 1.12 in Swarm Mode, so a solution for any would be fine.
Are you using the new Docker Swarm Mode that came in 1.12? There isn't currently a hook in Docker Swarm for this. However with Swarm Mode, you could use the Docker Remote API to collect events that trigger it instead of polling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With