I am using the Kubernetes Jenkins plugin on an external master. The default disk size is limited to 10GB. Adding a pvc with the name jenkins-workspace, mounts the disk, but it is created with root user 0755 and doesn't allow jenkins user any access.
- Jenkins 2.104 master
- jenkinsci/jnlp slave
- kubernetes 1.7.4
- rhel 7.4
We have a customized jnlp slave, but I have even tried using the default that the plugin pulls in.
Can anybody point me to documentation or related article that shows how to add privileges for the pvc mount or dynamically add space after provisioning.
Our Jenkins master uses the Kubernetes cloud connection from the Configure System with a Kubernetes pod template either pointing to the default jnlp or using a container template to point to our customized jnlp slave in our local registry.
Cheers, Appreciate the help in advance
It is possible to change the permission by using an init container, while defining the slave pod you can include one init container that mount the volume as root and change the permission to jenkins user.
You can not set the permissions of the mounted volumes (fsGroup
) nor the size of the PVC today. It is not implemented in https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/PersistentVolumeClaim.java so it just uses the cluster defaults (
It will be possible using YAML once https://github.com/jenkinsci/kubernetes-plugin/pull/275 is implemented.