How to mount NFS to jupyterhub on k8s

As I have NFS that store many different users‘’files,How to mount NFS to jupyterhub on k8s,so that the users who spawn a new notebook can access their own data?

First, you need to instruct K8s to use NFS as storage. In our deployment, we use csi-driver-nfs installed with Helm. Config looks something like this:

kind: StorageClass
  name: nfs-csi
  annotations: "true"
  server: *REDACTED*
  share: /media/storage
reclaimPolicy: Delete
volumeBindingMode: Immediate
  - nconnect=8  # only supported on linux kernel version >= 5.3
  - nfsvers=4.1
  - hard

After that, you follow instruction at user-storage docs of Z2JH.

1 Like