Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

WithDataVolume

Method
📦 CommunityToolkit.Aspire.Hosting.K3s v13.6.1
func (K3sClusterResource) WithDataVolume(options ...*WithDataVolumeOptions) K3sClusterResource

Signature

methodWithDataVolumebuilder
Mounts a named Docker volume at the k3s data directory so cluster state persists across AppHost restarts.
WithDataVolume(options ...*WithDataVolumeOptions) K3sClusterResource
options...*WithDataVolumeOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDataVolumeOptions argument.

Name*stringOptional volume name. When null (the default) a name is generated from the application and resource names.
K3sClusterResource

The same builder, for chaining.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types: