Kubernetes plugin containers can't connect back to Jenkins

I have a Jenkins and Kubernetes cluster running within the same network in AWS. Jenkins has it’s own instance.

I have configured the Kubernetes plugin as follows:
enter image description here

  • Github repo with more than one python packages
  • Content of a dockerfile to run glassfish server and deploy specific application from a git repository
  • Private gems are not getting installed in docker
  • Syntax error when adding SSH key in GitLab CI
  • Jenkins: running build does not provision docker slave
  • Cannot SSH using private key while building Docker image
  • The recommended JNLP docker image is used. Jenkins JNLP port is configured to be static 5000.

    Now when I kick off the job, it shows me that the node is offline. When I click on the offline node I get this:

    enter image description here

    This makes me go to the k8 cluster. Running docker ps shows no containers running. However:

    enter image description here

    From there I go to find what docker container gets run and what logs it leaves after that:

    enter image description here

    I use:
    https://github.com/jenkinsci/docker-jnlp-slave as image


    Jenkins version: 2.27

    k8: hyperkube:v1.4.3_coreos.0

    Jenkins does spin up the container, I guess it runs and errors out because no valid arguments are provided during the container run? I need it to be a hands off process where I don’t have to log in to my containers (Java clients). How do I achieve this?


    Based on this answer: kubernetes slaves cannot register to jenkins master

    If I log into the container and run the command that Jenkins displays under the host that cannot connect:

    java -jar /usr/share/jenkins/slave.jar -jnlpUrl https://test.myhost.com/computer/jenkinsminions-10f0b7d49054ac/slave-agent.jnlp -secret 62637e83008f50eb94483ad609e9a2719d313fa56e640e4beca9eebeaf0b1af2

    The container connects via JNLP2 and the job runs.

    I tried to add the arguments as suggested, but no luck. Containers still won’t connect automatically: enter image description here

  • Run batch scripts on a remote server (windows) from jenkins
  • Jenkins: HTTP error 403 when getting config
  • Automated build for developing ios and signing it
  • Configure saucelabs for jenkins
  • Issues with Jenkins and SVN proxy
  • Maven installation settings not showing in Jenkins
  • One Solution collect form web for “Kubernetes plugin containers can't connect back to Jenkins”

    Do you have a Root directory not writable message in the container log?

    Exception in thread "main" java.lang.RuntimeException: Root directory not writable
        at hudson.remoting.FileSystemJarCache.<init>(FileSystemJarCache.java:44)
        at hudson.remoting.Engine.<init>(Engine.java:139)
        at hudson.remoting.jnlp.Main.createEngine(Main.java:164)
        at hudson.remoting.jnlp.Main.main(Main.java:148)
        at hudson.remoting.jnlp.Main._main(Main.java:144)
        at hudson.remoting.jnlp.Main.main(Main.java:110)

    In this case, you might have a problem similar to this.

    PS: If you cannot see the logs, try removing the “Allocate pseudotty” option

    Git Baby is a git and github fan, let's start git clone.