I am setting up my jenkins on kubernetes via helm to run my java deployment,
This spawns new pods for every build -> fair enough
Then I see that I need to store some maven jars which will be used by other builds,
So I came up with NFS installation and mounted it to /home/jenkins/.m2 via jenkins configure (Web console)
Then I keep getting the
error org.apache.maven.repository.LocalRepositoryNotAccessibleException: Could not create local repository at /home/jenkins/.m2/repository
I even tried
securityContext: runAsUser: 1000 fsGroup: 1000
in the deployment.yaml
I tried adding
USER root RUN chown -R root /home/jenkins
in the slave container
Its just not with the .m2 , slave is not able to write anything on this pvc.
At this point I’m confused where else the problem could be. can some one please help?
I had similar issue. I solved this way: