Share via


PersistentVolumeSpecV1 Class

Definition

Represents the specification for a Kubernetes Persistent Volume. Defines the details of storage and access configurations for a PersistentVolume resource.

[YamlDotNet.Serialization.YamlSerializable]
public sealed class PersistentVolumeSpecV1
[<YamlDotNet.Serialization.YamlSerializable>]
type PersistentVolumeSpecV1 = class
Public NotInheritable Class PersistentVolumeSpecV1
Inheritance
PersistentVolumeSpecV1
Attributes
YamlDotNet.Serialization.YamlSerializableAttribute

Constructors

PersistentVolumeSpecV1()

Properties

AccessModes

Represents the access modes for a Persistent Volume in a Kubernetes cluster. AccessModes define the ways in which the volume can be mounted and utilized:

  • ReadWriteOnce: The volume can be mounted as read-write by a single node.
  • ReadOnlyMany: The volume can be mounted read-only by many nodes.
  • ReadWriteMany: The volume can be mounted as read-write by many nodes.
Capacity

Represents the storage capacity of the persistent volume. The keys in the dictionary represent capacity types (e.g., "storage"), and the values define the corresponding quantity for the capacity type.

ClaimRef

Gets or sets the reference to a claim within the Kubernetes cluster that is bound to the PersistentVolume. This property links the PersistentVolume to a specific PersistentVolumeClaim (PVC) via an object reference, allowing resources to be dynamically or statically provisioned as required.

HostPath

Gets or sets the configuration for a HostPath volume in a Kubernetes PersistentVolume. This property specifies the details of a HostPath volume source, allowing a directory from the host node file system to be mounted into a pod's container.

Local

Gets or sets the configuration for a local volume source.

MountOptions

Specifies a list of mount options for a persistent volume. Mount options are passed to the mount binary (e.g., NFS, Ceph) for configuring the volume at mount time. These options allow customization of mount behavior based on the filesystem or volume type.

NodeAffinity

Specifies constraints that limit which nodes a persistent volume can be accessed from.

PersistentVolumeReclaimPolicy

Describes the reclaim policy of a PersistentVolume in Kubernetes. The reclaim policy determines how a PersistentVolume should be treated when it is released from its associated PersistentVolumeClaim. Typical values include:

  • "Retain": Retains the volume for manual recovery.
  • "Recycle": Cleans the volume by removing its contents for reuse.
  • "Delete": Deletes the volume from storage.
StorageClassName

Specifies the name of the StorageClass associated with this persistent volume. The StorageClass provides dynamic provisioning parameters and policies for the storage resource. If no StorageClass is defined, the default StorageClass for the cluster will be applied if available.

VolumeAttributesClassName

Specifies the class name associated with volume attributes in a Kubernetes PersistentVolume specification. This property is typically used to indicate a custom class of attributes assigned to the persistent volume, enabling more granular configurations or specific behaviors for the volume.

VolumeMode

Specifies the volume mode of the persistent volume.

Applies to