Search code examples
jenkinsdockerdocker-swarm

How to Distribute Jenkins Slave Containers Within Docker Swarm


I would like to have my Jenkins master (not containerized) to create slaves within a container. So I have installed the docker plugin into jenkins, created a docker server, configured and jenkins does indeed spin up a slave container fine after the job creation. enter image description here

However, after I have created another docker server and created a swarm out of two of them and tried running jenkins jobs again it have continued to only deploy containers on the original server(which is now also a manager). I'd be expecting the swarm to balance the load and to distribute the newly created containers evenly across the swarm. What am I missing?

Do I have to use a service perhaps?


Solution

  • As of that moment there was nothing I could find in the swarm that would help me to manipulate container distribution across the swarm nodes.

    Ended up using a more flexible kubernetes for that purpose. I think marathon is capable of that as well.