Skip to content
Docs Try Aspire

VolumeMountV1

Class sealed net10.0
📦 Aspire.Hosting.Kubernetes v13.1.2-preview.1.26125.13
Represents a volume mount configuration in a Kubernetes container.
namespace Aspire.Hosting.Kubernetes.Resources;
public sealed class VolumeMountV1
{
// ...
}
This class is used to specify how a volume is mounted into a container, including the path within the container, any sub-paths, mount propagation settings, and read-only configurations.
View all constructors
MountPathget; set
string
Gets or sets the path within the container at which the volume will be mounted.
MountPropagationget; set
string?
Specifies the mount propagation behavior for the volume mount. Defines how mounts are propagated from the host to the container and vice versa. This property is typically used to control sharing of volumes between containers and impacts the way the volume is mounted in the container environment. Can be set to specific propagation modes such as "HostToContainer", "Bidirectional", or left null for default behavior.
Nameget; set
string
Gets or sets the name of the volume mount. This property specifies the identifier for the volume to be mounted, which is used to reference it within the container.
ReadOnlyget; set
bool?
Gets or sets a value indicating whether the volume mount is read-only.
RecursiveReadOnlyget; set
string?
Gets or sets the recursive read-only mode configuration for the volume mount. This property determines if the volume should be mounted in recursive read-only mode, which enforces read-only access on all subdirectories and files within the volume.
SubPathget; set
string
Specifies the relative path within the volume from which the container will access data. This property allows you to mount a specific subdirectory of a volume rather than the root directory.
SubPathExprget; set
string?
Gets or sets the sub-path expression within the volume mount. This property allows dynamic sub-paths to be specified using environment variable substitutions and provides flexibility for configuring paths at runtime.
View all properties