JupyterHub hub-db-dir PV Question

Hi there!

New-er administrator of a JupyterHub cluster here. We are running a few different clusters for JupyterHub, one which is in AWS, using Amazon’s hosted Kubernetes service. There’s an issue that we’ve begun to hit up against with nodes that auto scale. The hub-db-dir persistent volume that is attached to the hub container will get created, and then not be able to spin up on any nodes since they may be in a different availability zone. Here’s a GH forum where this is discussed:

Has anyone experimented with using a more persistent storage option? Having this pointed to an NFS share like user storage?

Hello,

Had the same desire but for a different reason: Azure disks are slow to provision and I got tired of waiting a minute or two for it to mount each time I upgraded the cluster. Turns out the trick is to create a persistent volume, persistent volume claim, and override the hub-db-dir value in config.yaml.

hub:
  extraVolumes:
    - name: hub-db-dir
      persistentVolumeClaim:
        claimName: userdata-pvc 

See https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/421#issuecomment-542981479 for creating the persistant volume and persistant volume claims.