Closed amioranza closed 6 years ago
Hi,
This is not a longhorn problem, it is a security context mssing on the deployment, we fixed it with the options below:
...
spec:
serviceAccountName: jenkins
securityContext:
runAsUser: 1000
fsGroup: 1000
containers:
- env:
...
Thanks.
Hi guys!
I'm trying to deploy an scalable jenkins on kubernetes using a persistent volume from longhorn to keep /var/jenkins_home.
This is my deployment file:
This is my pvc file:
This is the Dockerfile to generate the custom image:
The pvc uses the longhorn StorageClass created by the oficial helm deployment. When I submit the pvc it works as expected and create a new PV with 10Gi.
The problem happens with the deployment, when I submit the the deployment the jenkins container failed to start with this error message:
As a good practice the user running jenkins app is a user jenkins. This user don't have permission to write to /var/jenkins_home, but the Dockerfile execute a chown on the /var/jenkins_home to the user and group jenkins, but the longhorn doesn't respect it. I cannot find where I can specify other user than root to access longhorn volumes.
I've changed the Dockerfile to make a sleep and allow me to access the container to check the permissions, this is the final permissions:
There is a way to apply permissions for other users than root to access and make changes on longhorn mounts?
Thanks.