pub struct PersistentVolumeSpec {
pub capacity: BTreeMap<String, Quantity>,
pub persistent_volume_source: Option<PersistentVolumeSource>,
pub access_modes: Vec<String>,
pub claim_ref: Option<ObjectReference>,
pub persistent_volume_reclaim_policy: Option<String>,
pub storage_class_name: Option<String>,
pub mount_options: Vec<String>,
pub volume_mode: Option<String>,
pub node_affinity: Option<VolumeNodeAffinity>,
pub volume_attributes_class_name: Option<String>,
}
Expand description
PersistentVolumeSpec is the specification of a persistent volume.
Fields§
§capacity: BTreeMap<String, Quantity>
capacity is the description of the persistent volume’s resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity +optional
persistent_volume_source: Option<PersistentVolumeSource>
persistentVolumeSource is the actual volume backing the persistent volume.
access_modes: Vec<String>
accessModes contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes +optional +listType=atomic
claim_ref: Option<ObjectReference>
claimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding +optional +structType=granular
persistent_volume_reclaim_policy: Option<String>
persistentVolumeReclaimPolicy defines what happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming +optional
storage_class_name: Option<String>
storageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass. +optional
mount_options: Vec<String>
mountOptions is the list of mount options, e.g. [“ro”, “soft”]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options +optional +listType=atomic
volume_mode: Option<String>
volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. +optional
node_affinity: Option<VolumeNodeAffinity>
nodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume. +optional
volume_attributes_class_name: Option<String>
Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is a beta field and requires enabling VolumeAttributesClass feature (off by default). +featureGate=VolumeAttributesClass +optional
Implementations§
Source§impl PersistentVolumeSpec
impl PersistentVolumeSpec
Sourcepub fn persistent_volume_reclaim_policy(&self) -> &str
pub fn persistent_volume_reclaim_policy(&self) -> &str
Returns the value of persistent_volume_reclaim_policy
, or the default value if persistent_volume_reclaim_policy
is unset.
Sourcepub fn storage_class_name(&self) -> &str
pub fn storage_class_name(&self) -> &str
Returns the value of storage_class_name
, or the default value if storage_class_name
is unset.
Sourcepub fn volume_mode(&self) -> &str
pub fn volume_mode(&self) -> &str
Returns the value of volume_mode
, or the default value if volume_mode
is unset.
Sourcepub fn volume_attributes_class_name(&self) -> &str
pub fn volume_attributes_class_name(&self) -> &str
Returns the value of volume_attributes_class_name
, or the default value if volume_attributes_class_name
is unset.
Trait Implementations§
Source§impl Clone for PersistentVolumeSpec
impl Clone for PersistentVolumeSpec
Source§fn clone(&self) -> PersistentVolumeSpec
fn clone(&self) -> PersistentVolumeSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PersistentVolumeSpec
impl Debug for PersistentVolumeSpec
Source§impl Default for PersistentVolumeSpec
impl Default for PersistentVolumeSpec
Source§impl Message for PersistentVolumeSpec
impl Message for PersistentVolumeSpec
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.