kubeflow / kubeflow/notebooks

Use generateName instead of name for PVCs created by Notebook form

Open
#842 1 comment 0 reactions 0 assignees View on GitHub
area/v1 kind/enhancement priority/needs-triage
Dominant language
No language data
Stars
84
Forks
149
Avg merge
5d 15h
Merged PRs (30d)
29

Description

### Checks

- [x] I have searched the [existing issues](https://github.com/kubeflow/notebooks/issues).
- [x] My request is related to one of the components in the [`kubeflow/notebooks`](https://github.com/kubeflow/notebooks) repository.

### Motivation

### Problem
When creating a new Notebook, the Jupyter web app creates PersistentVolumeClaims (PVCs) with static names like `{notebook-name}-volume`. This causes issues when:
1. **PVC naming conflicts**: If a user deletes a notebook but the PVC is retained (or deletion is delayed), recreating a notebook with the same name fails because the PVC name already exists.
2. **Orphaned PVC cleanup**: When PVCs have static names tied to notebook names, it's harder to track which PVCs were auto-created vs manually created.

### Benefits
- Eliminates PVC naming conflicts when recreating notebooks
- Better UX for notebook recreation workflows
- Aligns with Kubernetes best practices for dynamically created resources

### Environment
- Kubeflow Notebooks v1
- Affects: `components/crud-web-apps/jupyter/frontend/`

### Implementation

### Proposed Solution
Use Kubernetes `generateName` instead of `name` for PVC metadata when creating new PVCs. This allows Kubernetes to automatically append a unique suffix (e.g., `mynotebook-volume-x7k2m`), preventing naming collisions.
The infrastructure for this partially exists—there's already a `setGenerateNameCtrl` helper function in `volumes/forms.ts` and `createMetadataFormGroupFromPvc` handles `generateName`. However, the default form creation in `createNewPvcFormGroup()` still uses static `name`.

### Changes Required
- `createNewPvcFormGroup()` should use `generateName` with a trailing `-` instead of `name`
- Update default volume name templates to end with `-` (required for `generateName`)
- Update workspace and data volume components to use the new naming pattern

### Are you willing & able to help?

- [x] I am able to submit a PR!
- [x] I can help test the feature!

Contributor guide

Open the contributing guide

Research direction

Start in components/crud-web-apps/jupyter/frontend/volumes/forms.ts, comparing setGenerateNameCtrl, createMetadataFormGroupFromPvc, and createNewPvcFormGroup(). Then inspect the workspace and data volume components for their default name templates. Done means newly created PVC forms use the generated-name pattern consistently and avoid conflicts when notebooks are recreated.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, kubernetes, typescript
Domain
cloud, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.