<p>Jenkins ver. 2.77
K8s Version: v1.6.6&quot;</p>
<p>We have installed the Jenkins Kubernetes Plugin and configured it to work with our K8s Cluster.
We are able to succesfully connect to the cluster when we test our connection via
“Manage Jenkins” -&gt; “Configure System” -&gt; Cloud, Kubernetes.</p>
<p>Our Template config can be seen here</p>
<p><a href="https://i.stack.imgur.com/l9i68.png" rel="nofollow noreferrer">Kubernetes Pod Termplate Config</a></p>
<p>We then create a simple job to test the plugin and see if the slaves would be created and then run a few simple bash commands.</p>
<p>The bash commands we are testing are:</p>
<pre><code>sleep 10
echo &quot;I am a slave&quot;
echo &quot;This is a K8s plugin generated slave&quot;
</code></pre>
<p>When we configured our Plugin we assigned the label &quot;autoscale&quot;. In addition we set up our job to work with the label autoscale.</p>
<p>Within the configuration of the Job under Label Expression we also see the following
&quot;Label autoscale is serviced by no nodes and 1 cloud&quot;</p>
<p>We then start the job in Jenkins &quot;Build Now&quot;
We then see the pods created in our K8s cluster</p>
<pre><code>jenkins-pod-slave-d4j3n                                           1/1       Running             0          21h
jenkins-pod-slave-tb2td                                           1/1       Running             0          21h
</code></pre>
<p>However note that under Build History we can see the following message</p>
<h1>1</h1>
<p>(pending—All nodes of label ‘autoscale’ are offline)</p>
<p>Investigating the logs of the pods outputs nothing</p>
<pre><code>kubectl logs jenkins-pod-slave-d4j3n
kubectl logs jenkins-pod-slave-tb2td
</code></pre>
<p>Investigation of the Jenkins logs we can see the following message appear.</p>
<p>Oct 08, 2017 6:18:16 PM org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud addProvisionedSlave
INFO: Template instance cap of 2 reached for template Jenkins-Pod-Slave, not provisioning: 2 running in namespace {3} with label {4}</p>
<ul>
<li>Our concern is that the namespace and label value are not being picked up correctly, and could be the source of the problem.</li>
</ul>

<p>your issue maybe the command and arguments.</p>

<p>the command should be blank, and the arguments should be set to:</p>

<p>${computer.jnlpmac} ${computer.name}</p>

<p>this will allow the jnlp slave to connect to the jenkins master correctly</p>
