Automatically provisioning new hosts with docker

How can you automatically create new machines when it is discovered that at the docker level insufficient resources have been found to plan all the services?

I use the configuration with the knapsack and the docker roaming scheduler, and if the resources are insufficient, the service creation fails:

exit status 1: Creating stresstest2_workerb1_1 Creating stresstest2_workerb2_1 no resources available to schedule container 

I can interrogate this status and call the docker machine when necessary, but the ranch will not try to redistribute the missing services. I wonder if there is a more integrated solution, perhaps a hook inside the docker rock, which can be used to dynamically call a docker machine to create or delete machines.

Now I am deciding between Rancher with Docker 1.11 + Docker Swarm or Docker 1.12 in Swarm mode, so the solution for anyone will be fine.

+5
source share
1 answer

Are you using the new Swocker Docker mode that came in 1.12? There is currently no hook in Docker Swarm. However, in Swarm mode, you can use the Docker Remote API to collect events that fire it instead of polling.

+1
source

All Articles