Skip to content

feat: use generateName for PVCs created by Notebook form#843

Open
neo99zhang wants to merge 1 commit intokubeflow:notebooks-v1from
neo99zhang:feat/use-generatename-for-notebook-pvcs
Open

feat: use generateName for PVCs created by Notebook form#843
neo99zhang wants to merge 1 commit intokubeflow:notebooks-v1from
neo99zhang:feat/use-generatename-for-notebook-pvcs

Conversation

@neo99zhang
Copy link

What this PR does

Changes the Jupyter Notebook form to use Kubernetes generateName instead of name when creating new PVCs. This prevents naming conflicts when notebooks are recreated or when PVCs from deleted notebooks still exist.

Why

Currently, PVCs are created with static names like {notebook-name}-volume. If a notebook is deleted but the PVC persists (common with Retain reclaim policies or delayed cleanup), recreating a notebook with the same name fails due to PVC naming conflict.

Using generateName allows Kubernetes to auto-generate unique suffixes, e.g., mynotebook-volume-x7k2m.

Changes

File Change
shared/utils/volumes/forms.ts createNewPvcFormGroup(): use generateName instead of name; default name ends with -
form-workspace-volume.component.ts Update workspace volume name to {notebook-name}-workspace-
form-data-volumes.component.ts Update data volume name to {notebook-name}-datavol-{n}-

How to test

  1. Deploy the updated Jupyter web app
  2. Create a new notebook with default volume settings
  3. Verify PVC is created with a generated suffix (e.g., mynotebook-workspace-x7k2m)
  4. Delete the notebook (keeping the PVC)
  5. Create a new notebook with the same name
  6. Verify a new PVC is created without conflict

Notes

  • The setGenerateNameCtrl helper and generateName handling in createMetadataFormGroupFromPvc already exist, so this change builds on existing infrastructure
  • Volume name templates now end with - as required by Kubernetes generateName spec

Closes #842

@github-project-automation github-project-automation bot moved this to Needs Triage in Kubeflow Notebooks Jan 21, 2026
@google-oss-prow google-oss-prow bot added size/XS area/backend area - related to backend components labels Jan 21, 2026
@google-oss-prow google-oss-prow bot requested a review from elenzio9 January 21, 2026 00:25
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign orfeas-k for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot requested a review from orfeas-k January 21, 2026 00:25
@google-oss-prow google-oss-prow bot added area/frontend area - related to frontend components area/v1 area - version - kubeflow notebooks v1 labels Jan 21, 2026
@neo99zhang neo99zhang force-pushed the feat/use-generatename-for-notebook-pvcs branch from 37a7057 to f528dcf Compare January 21, 2026 00:29
@neo99zhang neo99zhang changed the title feat(jupyter): use generateName for PVCs created by Notebook form feat: use generateName for PVCs created by Notebook form Jan 21, 2026
Changes the Jupyter Notebook form to use Kubernetes generateName instead
of name when creating new PVCs. This prevents naming conflicts when
notebooks are recreated or when PVCs from deleted notebooks still exist.

Changes:
- createNewPvcFormGroup(): use generateName instead of name
- Default volume names now end with '-' (required for generateName)
- Workspace volume: {notebook-name}-workspace-
- Data volumes: {notebook-name}-datavol-{n}-

Signed-off-by: Feiyu Zhang <feiyuzhang@nianticlabs.com>
Signed-off-by: feiyuzhang <feiyuzhang@nianticlabs.com>
@neo99zhang neo99zhang force-pushed the feat/use-generatename-for-notebook-pvcs branch from f528dcf to a97c046 Compare January 21, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend area - related to backend components area/frontend area - related to frontend components area/v1 area - version - kubeflow notebooks v1 size/XS

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant