1.85. io.k8s.api.core.v1.PersistentVolumeSpec schema


描述
PersistentVolumeSpec 是持久性卷的规格。
类型
对象

模式

Expand
属性类型描述

accessModes

数组(字符串)

accessModes 包含可以挂载卷的所有方法。更多信息: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes

awsElasticBlockStore

AWSElasticBlockStoreVolumeSource

awsElasticBlockStore 代表一个 AWS Disk 资源,附加到 kubelet 的主机机器,然后公开给 pod。弃用:AWSElasticBlockStore 已被弃用。in-tree awsElasticBlockStore 类型的所有操作都会重定向到 ebs.csi.aws.com CSI 驱动程序。更多信息: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

azureDisk

AzureDiskVolumeSource

azureDisk 代表主机上的 Azure Data Disk 挂载,并绑定到 pod。已弃用:AzureDisk 已被弃用。in-tree azureDisk 类型的所有操作都会重定向到 disk.csi.azure.com CSI 驱动程序。

azureFile

AzureFilePersistentVolumeSource

azureFile 代表主机上的 Azure File Service 挂载,并绑定到 pod。已弃用:AzureFile 已被弃用。in-tree azureFile 类型的所有操作都会重定向到 file.csi.azure.com CSI 驱动程序。

capacity

对象(Quantity)

capacity 是持久性卷资源和容量的描述。更多信息: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity

cephfs

CephFSPersistentVolumeSource

CephFS 代表共享 pod 生命周期的主机上的 Ceph FS 挂载。弃用:CephFS 已被弃用,in-tree cephfs 类型不再被支持。

cinder

CinderPersistentVolumeSource

Cinder 代表附加并挂载到 kubelet 主机机器上的 cinder 卷。已弃用:Cinder 已被弃用。in-tree cinder 类型的所有操作都会重定向到 cinder.csi.openstack.org CSI 驱动程序。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md

claimRef

ObjectReference

claimRef 是 PersistentVolume 和 PersistentVolumeClaim 之间的双向绑定的一部分。当 bound. claim.VolumeName 是 PV 和 PVC 之间的权威绑定时,预期为非 nil。更多信息: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding

csi

CSIPersistentVolumeSource

CSI 代表由外部 CSI 驱动程序处理的存储。

fc

FCVolumeSource

FC 代表附加到 kubelet 主机机器的光纤通道资源,然后公开给 pod。

flexVolume

FlexPersistentVolumeSource

FlexVolume 代表使用基于 exec 的插件置备的/附加的通用卷资源。已弃用:FlexVolume 已被弃用。考虑使用 CSIDriver 替代。

flocker

FlockerVolumeSource

flocker 代表附加到 kubelet 主机机器的 Flocker 卷,并公开给 pod 以供使用。这取决于正在运行的 Flocker 控制服务。已弃用:Flocker 已弃用,in-tree flocker 类型不再被支持。

gcePersistentDisk

GCEPersistentDiskVolumeSource

gcePersistentDisk 代表一个 GCE Disk 资源,该资源附加到 kubelet 的主机机器,然后公开给 pod。由管理员调配。已弃用: GCEPersistentDisk 已被弃用。树内 gcePersistentDisk 类型的所有操作都会重定向到 pd.csi.storage.gke.io CSI 驱动程序。更多信息: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk

glusterfs

GlusterfsPersistentVolumeSource

GlusterFS 代表附加到主机的 Glusterfs 卷,并公开给 pod。由管理员调配。已弃用: Glusterfs 已被弃用,in-tree glusterfs 类型不再被支持。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md

hostPath

HostPathVolumeSource

hostpath 代表主机上的一个目录。由开发人员或测试者调配。这仅适用于单节点开发和测试。主机存储不以任何方式支持,在多节点集群中的 WILL NOT WORK 不被支持。更多信息: https://kubernetes.io/docs/concepts/storage/volumes#hostpath

iscsi

ISCSIPersistentVolumeSource

iSCSI 代表附加到 kubelet 主机机器的 ISCSI Disk 资源,然后公开给 pod。由管理员调配。

local

LocalVolumeSource

Local 代表带有节点关联性的直接附加存储

mountOptions

数组(字符串)

mountOptions 是挂载选项的列表,如 ["ro", "soft"]。未验证 - 如果挂载无效,则挂载将失败。更多信息: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options

nfs

NFSVolumeSource

NFS 代表主机上的 NFS 挂载。由管理员调配。更多信息: https://kubernetes.io/docs/concepts/storage/volumes#nfs

nodeAffinity

VolumeNodeAffinity

nodeAffinity 定义限制来限制可以从哪个节点访问这个卷。此字段会影响使用这个卷的 pod 的调度。

persistentVolumeReclaimPolicy

string

persistentVolumeReclaimPolicy 定义从声明中释放持久性卷时会发生什么。有效选项为 Retain (手动创建 PersistentVolume 的默认设置)、Delete (动态置备的 PersistentVolume 的默认)和 Recycle (已弃用)。Recycle 必须由此 PersistentVolume 的卷插件支持。更多信息: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming

可能枚举值: - "Delete" 表示该卷将从声明发行版中从 Kubernetes 版本中删除。卷插件必须支持 Deletion. - "Recycle" 意味着该卷将从声明中回收回未绑定持久性卷的池。卷插件必须支持 Recycling。- "Retain" 表示卷将保留在当前阶段(Released),供管理员手动重新声明。默认策略为 Retain。

photonPersistentDisk

PhotonPersistentDiskVolumeSource

photonPersistentDisk 代表附加并挂载到 kubelets 主机上的 PhotonController 持久磁盘。弃用: PhotonPersistentDisk 已被弃用,in-tree photonPersistentDisk 类型不再被支持。

portworxVolume

PortworxVolumeSource

portworxVolume 代表附加并挂载到 kubelets 主机上的 portworx 卷。已弃用:PortworxVolume 已被弃用。当 CSIMigrationPortworx feature-gate 为 on 时,in-tree portworxVolume 类型的所有操作都会被重定向到 pxd.portworx.com CSI 驱动程序。

quobyte

QuobyteVolumeSource

quobyte 代表共享 pod 生命周期的主机上执行 Quobyte 挂载。已弃用:Quobyte 已弃用,in-tree Quobyte 类型不再被支持。

rbd

RBDPersistentVolumeSource

RBD 代表共享 pod 生命周期的主机上 Rados 块设备挂载。已弃用:RBD 已被弃用,in-tree rbd 类型不再被支持。更多信息: https://examples.k8s.io/volumes/rbd/README.md

scaleIO

ScaleIOPersistentVolumeSource

scaleIO 代表附加并挂载到 Kubernetes 节点上的 ScaleIO 持久性卷。已弃用:ScaleIO 已被弃用,in-tree scaleIO 类型不再被支持。

storageClassName

string

storageClassName 是此持久性卷所属的 StorageClass 的名称。空值表示这个卷不属于任何 StorageClass。

storageos

StorageOSPersistentVolumeSource

storageos 代表一个 StorageOS 卷,它附加到 kubelet 的主机机器并挂载到 pod。已弃用:StorageOS 已被弃用,in-tree storageos 类型不再被支持。更多信息:https://examples.k8s.io/volumes/storageos/README.md

volumeAttributesClassName

string

此持久性卷所属的 VolumeAttributesClass 的名称。不允许为空值。如果没有设置此字段,这表示此卷不属于任何 VolumeAttributesClass。此字段是可变的,可在卷成功更新为新类后由 CSI 驱动程序更改。对于 unbound PersistentVolume,volumeAttributesClassName 将在绑定过程中与 unbound PersistentVolumeClaims 匹配。这是一个 beta 字段,需要启用 VolumeAttributesClass 功能(默认关闭)。

volumeMode

字符串

volumeMode 定义卷是否要与格式化的文件系统一起使用,或者保持在原始块状态。当没有包含在 spec 中时,文件系统的值会被表示。

可能枚举值: - "Block" 表示卷不会格式化为文件系统,并保留原始块设备。- "Filesystem" 表示卷将被格式化为文件系统或使用文件系统格式化。

vsphereVolume

VsphereVirtualDiskVolumeSource

vsphereVolume 代表附加并挂载到 kubelets 主机上的 vSphere 卷。已弃用:VsphereVolume 已被弃用。in-tree vsphereVolume 类型的所有操作都会重定向到 csi.vsphere.vmware.com CSI 驱动程序。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat