Skip to content

fix: prevent duplicate volumes when same PVC is mounted to multiple paths#1023

Open
Jaehyeon1020 wants to merge 1 commit intokubeflow:notebooks-v1from
Jaehyeon1020:fix/duplicate-notebook-volumes
Open

fix: prevent duplicate volumes when same PVC is mounted to multiple paths#1023
Jaehyeon1020 wants to merge 1 commit intokubeflow:notebooks-v1from
Jaehyeon1020:fix/duplicate-notebook-volumes

Conversation

@Jaehyeon1020
Copy link
Copy Markdown

@Jaehyeon1020 Jaehyeon1020 commented Apr 14, 2026

When the same PVC is mounted to multiple paths via the Jupyter Web App UI, add_notebook_volume appends a V1Volume with the same name for each mount. This causes a Kubernetes validation error (duplicate volume names in spec.volumes) and the Pod fails to start.

Fix: Track already-added volume names in the volume creation loop (post.py) to skip duplicate add_notebook_volume calls. add_notebook_container_mount is unchanged since multiple volumeMounts referencing the same volume is valid in Kubernetes.

How to test:

  1. Create a new notebook with the same PVC mounted to two different paths (e.g. /data and /backup)
  2. Verify the Pod starts successfully with one volume entry and two volume mounts

@github-project-automation github-project-automation bot moved this to Needs Triage in Kubeflow Notebooks Apr 14, 2026
@google-oss-prow google-oss-prow bot added the area/backend area - related to backend components label Apr 14, 2026
@google-oss-prow google-oss-prow bot requested a review from kimwnasptd April 14, 2026 12:46
@google-oss-prow
Copy link
Copy Markdown

[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 thesuperzapper 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 added area/frontend area - related to frontend components area/v1 area - version - kubeflow notebooks v1 size/M labels Apr 14, 2026
@Jaehyeon1020 Jaehyeon1020 force-pushed the fix/duplicate-notebook-volumes branch from 8e010cd to cf3ab22 Compare April 14, 2026 14:00
…aths

When the same PVC is configured with multiple mount paths in the web UI,
the volume creation loop calls add_notebook_volume for each mount, adding
a V1Volume with the same name multiple times. This causes a Kubernetes
validation error due to duplicate volume names in the PodSpec.

Track already-added volume names in the loop to skip duplicates while
still adding all volume mounts.

Signed-off-by: Jaehyeon1020 <[email protected]>
@Jaehyeon1020 Jaehyeon1020 force-pushed the fix/duplicate-notebook-volumes branch from decc5e8 to f64b579 Compare April 14, 2026 14:16
@google-oss-prow google-oss-prow bot added size/XS and removed size/M labels Apr 14, 2026
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