microsoft / microsoft/aspire

Add volume name option to WithPersistentVolume APIs to support binding pre-existing volumes

Open
#19,633 3 comments 0 reactions 0 assignees View on GitHub
area-deployment area-integrations needs-area-label triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

Please add an option to the `WithPersistentVolume` APIs to specify a volume name when configuring persistent storage.

**Problem**

Current behavior appears focused on dynamic provisioning. In some environments, we need to bind to a pre-existing persistent volume already present in the cluster (for example: manually provisioned storage, migrations, or policy-constrained environments).

Without a way to set volume name, it’s hard to reliably target an existing volume and avoid dynamic allocation.

**Proposed change**

Add an overload or option on WithPersistentVolume APIs to allow setting a Kubernetes volume name (or equivalent binding field), so Aspire can request/use a pre-existing volume.

Example (illustrative):
C#

`.WithPersistentVolume(volumeName: "existing-shared-pv")`

Expected outcome

Bind Aspire resources to specific, already-provisioned volumes.
Better support for static provisioning and enterprise cluster constraints.
Improved migration/interoperability with existing Kubernetes storage setups.

Contributor guide

Open the contributing guide

Research direction

Start by locating the WithPersistentVolume APIs and tracing how their volume configuration becomes a Kubernetes binding. Review the existing API shape and persistence-related tests before deciding between an overload and an option; done means a caller can target the named pre-existing volume while existing dynamic provisioning behavior remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, kubernetes
Domain
infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.