Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-deploymentarea-integrationsIssues pertaining to Aspire Integrations packagesneeds-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownerstriage:bot-seenAspire triage bot has seen this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions