Volume mount is not happening using Kubernetes plugin in Jenkins

8/22/2017

I am using Kubernetes to spin up jenkins slaves on for my builds. I can get the plugin working without any issues.

Now, I am trying to mount a volume using the plugin. After adding the Volumes information in the plugin, its not even starting the container. I am not sure what is missing here.

In Docker file, I have added this line:

VOLUME /home/myslave

In POD Template(under jenkins configuration) I have these volume configurations:

Host path:/jenkins/slave

Mount path:/home/myslave

Thanks in advance.

-- how it works
jenkins
kubernetes

1 Answer

9/5/2018

You need to do 3 actions to fix this issue:

  1. rename your container name to jnlp in the kubernetes plugin.
  2. keep the JNLP configured correctly in your images ENTRYPOINT
  3. let "command to run" and arguments to pass to the command empty.
-- Eric Chen
Source: StackOverflow