<p>I'm trying to mount existing google cloud Persistent Disk(balanced) to Jenkins in Kubernetes.
In the root of the disk located fully configured Jenkins. I want to bring up Jenkins in k8s with already prepared configuration on google Persistent Disk.</p>
<p>I'm using latest chart from the <a href="https://charts.jenkins.io" rel="nofollow noreferrer">https://charts.jenkins.io</a> repo</p>
<p>Before run <code>helm install</code> I'm applying pv and pvc.</p>
<p><strong>PV</strong> for existent disk:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: jenkins-persistent-volume
spec:
  storageClassName: standard
  capacity:
    storage: 50Gi
  accessModes:
    - ReadWriteOnce
  csi:
    driver: pd.csi.storage.gke.io
    volumeHandle: projects/Project/zones/us-central1-a/disks/jenkins-pv
    fsType: ext4
</code></pre>
<p><strong>PVC</strong></p>
<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: jenkins-pvc
  namespace: jenkins
spec:
  volumeName: jenkins-persistent-volume
  accessModes:
    - &quot;ReadWriteOnce&quot;
  resources:
    requests:
      storage: &quot;50Gi&quot;
</code></pre>
<p><a href="https://i.stack.imgur.com/W1k4j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W1k4j.png" alt="pv" /></a>
<a href="https://i.stack.imgur.com/XQaPK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XQaPK.png" alt="pvc" /></a></p>
<p>Files in Persistent Google Disk are 100% <strong>1000:1000</strong> permissions (uid, gid)</p>
<p>I made only one change in official helm chart, it was in values file</p>
<pre><code>  existingClaim: &quot;jenkins-pvc&quot;
</code></pre>
<p>After running <code>helm install jenkins-master . -n jenkins</code>
I'm getting next:
<a href="https://i.stack.imgur.com/wzbxM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wzbxM.png" alt="failed pod" /></a></p>
<p>Just for ensure that problem not from GCP side.
I mount pvc to busybox and it works perfect.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
    - name: busybox
      image: busybox:1.32.0
      command:
        - &quot;/bin/sh&quot;
      args:
        - &quot;-c&quot;
        - &quot;while true; do echo $(date) &gt;&gt; /app/buffer; cat /app/buffer; sleep 5; done;&quot;
      volumeMounts:
        - name: my-volume
          mountPath: /app
  volumes:
    - name: my-volume
      persistentVolumeClaim:
        claimName: jenkins-pvc
</code></pre>
<p><a href="https://i.stack.imgur.com/3PBIb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3PBIb.png" alt="busybox" /></a></p>
<p>I tried to change a lot of values in values.yaml also tried use old charts, or even <strong>bitnami charts</strong> with deployment instead of stateful set, but always error is the same.
Could somebody shows my the right way please.</p>
<p><strong>Storage classes</strong>
<a href="https://i.stack.imgur.com/wgGbL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wgGbL.png" alt="storage classes" /></a></p>

Артем Черемісін
<p>Try set the <code>podSecurityContextOverride</code> and re-install:</p>
<pre><code>controller:
  podSecurityContextOverride:
    runAsUser: 1000
    runAsNonRoot: true
    supplementalGroups: [1000]
persistence:
  existingClaim: &quot;jenkins-pvc&quot;
</code></pre>
