Skip to content

Kubespawner deletes PVC even if the pvcNameTemplate doesn't include username #880

Open
@manics

Description

@manics

Bug description

If a shared dynamically created PVC is used and a JupyterHub user is deleted KubeSpawner will incorrectly delete the shared PVC.

How to reproduce

Use this Z2JH singleuser.storage config with the latest release 4.1.0

singleuser:
  storage:
    dynamic:
      storageClass: nfs
      pvcNameTemplate: claim-jupyter
      subPath: "{user_server}"

This is not a typical configuration since Z2JH's PVC support is used purely for convenience to create just a single shared PVC. However it's possible to conceive of other semi-static pvcNameTemplate, for example you could use profileList with kubespawner_overrides to set pvcNameTemplate=<profilename> to have a shared volume across multiple users.

Expected behaviour

PVC should not be deleted

Actual behaviour

It's deleted- though in practice it may get stuck because of the subPaths

Your personal set up

  • OS:
  • Version(s):
Full environment
# paste output of `pip freeze` or `conda list` here
Configuration
# jupyterhub_config.py
Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions