Add volume name option to WithPersistentVolume APIs to support binding pre-existing volumes
- 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
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