<h2>Problem</h2>

<p>Hi I recently deployed csanchez's jenkins-kubernetes build on a local kubernetes build (<a href="https://github.com/jenkinsci/kubernetes-plugin" rel="nofollow">https://github.com/jenkinsci/kubernetes-plugin</a>).  This also means I used the provided jenkins-local.yml and service-local.yml. The build deployed well and everything is set up.  However, when I try to run multiple jobs at once the jobs wait in queue and only one executor is spawned.  Each of the jobs executes a shell script which prints "hello x friend" and then calls "sleep 1m or 30s".</p>

<p>Is there a certain criteria in which the plugin will spawn multiple containers?  Is it supposed to spawn a container (as long as it doesn't surpass the container cap) for each job in queue?</p>

<h2>Build info</h2>

<p>Jenkins build: 1.642.2 <br>
Kubernetes plugin: 0.6 <br>
Kubernetes: 1.2 <br></p>

<p>The kubernetes plugin points to the internal jenkins master at containter0ip:8080<br>
The container cap is at 5 <br>
The docker image deployed is jenkin/jnlp-slave</p>

<p><em>Edit</em></p>

<p>When there are multiple jobs in queue, sometimes more than one executor becomes live.  After reading the logs of the containers who die, all of them die because they cannot connect to containerip:8080/tcpSlaveAgentListener/.</p>

<p>There is additional configuration needed for Jenkins to spawn agents ASAP, see <a href="https://github.com/jenkinsci/kubernetes-plugin#over-provisioning-flags" rel="nofollow noreferrer">https://github.com/jenkinsci/kubernetes-plugin#over-provisioning-flags</a></p>

<p>In short add Jenkins startup parameters</p>

<pre><code>-Dhudson.slaves.NodeProvisioner.MARGIN=50 -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85
</code></pre>

<p>and restart Jenkins server</p>
