I can see that the the volume has rightly been claimed by the jenkins pod:
oc get pvc NAME LABELS STATUS VOLUME CAPACITY ACCESSMODES AGE jenkins template=jenkins-persistent-template Bound jenkinsdata 20Gi RWO 39m
but I'm seeing Permission errors in the deployment logs:
Copying Jenkins configuration to /var/lib/jenkins ... cp: cannot create regular file '/var/lib/jenkins/config.xml.tpl': Permission denied cp: cannot create directory '/var/lib/jenkins/jobs': Permission denied cp: cannot create directory '/var/lib/jenkins/users': Permission denied mkdir: cannot create directory '/var/lib/jenkins/plugins': Permission denied Copying 1 Jenkins plugins to /var/lib/jenkins ... cp: cannot create regular file '/var/lib/jenkins/plugins/': Not a directory Creating initial Jenkins 'admin' user ... sed: can't read /var/lib/jenkins/users/admin/config.xml: No such file or directory /usr/libexec/s2i/run: line 36: /var/lib/jenkins/password: Permission denied touch: cannot touch '/var/lib/jenkins/configured': Permission denied Running from: /usr/lib/jenkins/jenkins.war webroot: EnvVars.masterEnvVars.get("JENKINS_HOME") Feb 12, 2016 8:50:29 AM winstone.Logger logInternal INFO: Beginning extraction from war file Feb 12, 2016 8:50:29 AM winstone.Logger logInternal INFO: Winstone shutdown successfully Feb 12, 2016 8:50:29 AM winstone.Logger logInternal SEVERE: Container startup failed java.io.FileNotFoundException: /var/lib/jenkins/war/META-INF/MANIFEST.MF (No such file or directory) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at java.io.FileOutputStream.<init>(FileOutputStream.java:162) at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:280) at winstone.HostConfiguration.<init>(HostConfiguration.java:83) at winstone.HostGroup.initHost(HostGroup.java:66) at winstone.HostGroup.<init>(HostGroup.java:45) at winstone.Launcher.<init>(Launcher.java:143) at winstone.Launcher.main(Launcher.java:354) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at Main._main(Main.java:293) at Main.main(Main.java:98)
I thought that setting the permissions to 777 would guarantee that anyone can do anything with the files under /var/lib/jenkins but that is apparently not the case. Of course, ideally I would know what user and group is going to want to use this directory but I have trouble finding out about this, especially since the user is running from within the jenkins container (to be honest this *really* gets me confused).