Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

K3sClusterResource.WithDataVolume

Method
📦 CommunityToolkit.Aspire.Hosting.K3s v13.6.1
type K3sClusterResource interface {
// ... omitted for brevity
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().

Defined on

This method is defined on the following type: