Setting up a Shared Workspace for users

I have currently setup a jupyterhub instance on our orgs kubernetes cluster. I have used the chart version 3.3.8 as the kube version was old to support newer ones.
Currently each user who logs in with org credentials a unique pv is created. But I want to create a shared workspace where multiple people can use. How to do it?

Have a look at

I did it but users can’t create any files inside the /home/shared or /home/jovyan/shared(also tried). the permission are set for root user.

storage:
    type: dynamic
    extraLabels: {}
    extraVolumes: 
      - name: jupyterhub-shared
        persistentVolumeClaim:
          claimName: jt-shared-workspace-pvc
    extraVolumeMounts:
      - name: jupyterhub-shared
        mountPath: /home/shared
    static:
      pvcName:
      subPath: "{username}"
    capacity: 1Gi # have change to 10Gi later
    homeMountPath: /home/jovyan
    dynamic:
      storageClass: csi-sc-cinder-lagos
      pvcNameTemplate: claim-{username}{servername}
      volumeNameTemplate: volume-{username}{servername}
      storageAccessModes: [ReadWriteOnce]

i went into the pod and checked this:
jovyan@jupyter-shaik-5c-2c-20sameer:~$ ls -ld /home/shared/
drwxr-xr-x 3 root root 4096 Jul 18 22:30 /home/shared/

You can try setting singleuser.fsGid but this requires your storage controller to support this capability- check your storage controller documentation, or ask your K8s admin. Alternatively you could manually create an admin pod and chgrp it?

I got that working by doing this in singleuser:

  initContainers:
    - name: fix-shared-permissions
      image: busybox
      securityContext:
        runAsUser: 0
      volumeMounts:
        - name: jupyterhub-shared
          mountPath: /home/jovyan/shared
      command:
        - sh
        - -c
        - |
          chown -R 1000:100 /home/jovyan/shared && chmod -R u+rwX /home/jovyan/shared

But the next steps is to mount the ldap group specific shared volumes everytime a user logs in. Do you know anything in that matter.

You can try adding a modify_pod_hook to mount some custom volumes.