<p>I have a kubernetes cluster (hosted at the university, not in gcloud) and I'm trying to use Jenkins with the jenksci/kubernetes plugin to launch the slaves. However, it seems they cannot register to the master, no matter what I do. (k8s 1.2, jenkins 2.19.2, kub-plugin 0.9)</p>

<p>This is the configuration I use:</p>

<p><a href="https://i.stack.imgur.com/DZjRN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DZjRN.png" alt="This is the configuration I use"></a>
Now:</p>

<ul>
<li><p>If I set tty:true the container starts but is never able to connect to the master. The logs are unreadable and I cannot attach to the slave to inspect what is happening:</p>

<pre><code>$ kubectl logs jnpl-slave-ec16b9ae7bbd --namespace=jenkins
Error from server: Unrecognized input header
$ kubectl attach -ti jnpl-slave-ec16b9ae7bbd --namespace=jenkins 
error: pod jnpl-slave-ec16b9ae7bbd is not running and cannot be attached to; current phase is Succeeded
</code></pre></li>
<li><p>If I set tty:false the container starts and correctly executes the entrypoint /usr/local/bin/jenkins-slave, but it seems that the secret and the slaveName command-line args are not passed, as the process dies asking for them:</p>

<pre><code>$ kubectl logs jnpl-slave-ecfd3a6cbaba --namespace=jenkins
Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to alter the behavior
two arguments required, but got []
...
</code></pre></li>
<li><p>If I manually set the parameters (seed and the slave name) to a fake value, it starts correctly, but then dies complaining that /home/jenkins is not writable:</p>

<pre><code>Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to alter the behavior
hudson.remoting.jnlp.Main createEngine
Setting up slave: http://10.254.151.87
hudson.remoting.jnlp.Main$CuiListener &lt;init&gt;
INFO: Jenkins agent is running in headless mode.
Exception in thread "main" java.lang.RuntimeException: Root directory not writable
...
</code></pre></li>
<li><p>However, if I create a slave manually on the webpage setup it, it works and I can see the slave online:</p>

<pre><code>node$ sudo docker run -ti docker.io/jenkinsci/jnlp-slave:latest /bin/bash
pod$ java -jar /usr/share/jenkins/slave.jar -jnlpUrl http://10.254.151.87/computer/slave1/slave-agent.jnlp
...
INFO: Connected
</code></pre></li>
</ul>

<p>So... I don't know what to test further. I would really appreciate if someone could give me an hint!</p>

<p>With best regards,</p>

<p>Mario</p>

<p>The arguments field should be <code>${computer.jnlpmac} ${computer.name}</code> and should be set by default when adding new containers to the Pod definition</p>
