PersistentVolume

PersistentVolume (PV) 是由管理员供应的存储资源。

apiVersion: v1

import "k8s.io/api/core/v1"

PersistentVolume

PersistentVolume (PV) 是由管理员供应的存储资源。它类似于一个节点。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/persistent-volumes


PersistentVolumeSpec

PersistentVolumeSpec 是持久卷的规范。


  • accessModes ([]string)

    原子性:在合并期间将被替换

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

  • capacity (map[string]Quantity)

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

  • claimRef (ObjectReference)

    claimRef 是 PersistentVolume 和 PersistentVolumeClaim 之间双向绑定的一个组成部分。绑定时应为非空。claim.VolumeName 是 PV 和 PVC 之间权威性的绑定。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/persistent-volumes#binding

  • mountOptions ([]string)

    原子性:在合并期间将被替换

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

  • nodeAffinity (VolumeNodeAffinity)

    nodeAffinity 定义了限制此卷可以从哪些节点访问的约束。此字段会影响使用此卷的 Pod 的调度。

    VolumeNodeAffinity 定义了限制此卷可以从哪些节点访问的约束。

    • nodeAffinity.required (NodeSelector)

      required 指定了必须满足的硬性节点约束。

      节点选择器表示一个或多个标签查询在一组节点上的结果的并集;也就是说,它表示节点选择器项所表示的选择器的 OR 运算。

      • nodeAffinity.required.nodeSelectorTerms ([]NodeSelectorTerm), required

        原子性:在合并期间将被替换

        必需。节点选择器项的列表。这些项是 OR 关系。

        空或空的节点选择器项不匹配任何对象。它们的要求是 AND 关系。TopologySelectorTerm 类型实现了 NodeSelectorTerm 的子集。

        • nodeAffinity.required.nodeSelectorTerms.matchExpressions ([]NodeSelectorRequirement)

          原子性:在合并期间将被替换

          通过节点标签列出的节点选择器要求列表。

        • nodeAffinity.required.nodeSelectorTerms.matchFields ([]NodeSelectorRequirement)

          原子性:在合并期间将被替换

          通过节点字段列出的节点选择器要求列表。

  • persistentVolumeReclaimPolicy (string)

    persistentVolumeReclaimPolicy 定义了持久卷从其声明中释放时会发生什么。有效选项包括 Retain(手动创建 PersistentVolume 的默认值)、Delete(动态供应 PersistentVolume 的默认值)和 Recycle(已弃用)。Recycle 必须由该 PersistentVolume 底层卷插件支持。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/persistent-volumes#reclaiming

  • storageClassName (string)

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

  • volumeAttributesClassName (string)

    此持久卷所属的 VolumeAttributesClass 的名称。不允许为空值。如果此字段未设置,则表示此卷不属于任何 VolumeAttributesClass。此字段是可变的,并且在卷成功更新到新类后可以由 CSI 驱动程序更改。对于未绑定的 PersistentVolume,volumeAttributesClassName 将在绑定过程中与未绑定的 PersistentVolumeClaims 匹配。

  • volumeMode (string)

    volumeMode 定义了卷是打算与格式化的文件系统一起使用,还是保持原始块状态。如果未包含在 spec 中,则默认为 Filesystem。

Local

  • hostPath (HostPathVolumeSource)

    hostPath 表示主机上的一个目录。由开发人员或测试人员提供。这仅适用于单节点开发和测试!多节点集群中不支持主机存储,并且无法工作。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/volumes#hostpath

    表示映射到 Pod 的主机路径。主机路径卷不支持所有权管理或 SELinux 重新标记。

  • local (LocalVolumeSource)

    local 表示带有节点亲和性的直接连接存储

    Local 表示带有节点亲和性的直接连接存储

    • local.path (string), required

      节点上卷的完整路径。它可以是目录或块设备(磁盘、分区等)。

    • local.fsType (string)

      fsType 是要挂载的文件系统类型。仅当 Path 是块设备时适用。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。如果未指定,则默认值是自动选择文件系统。

持久卷

  • awsElasticBlockStore (AWSElasticBlockStoreVolumeSource)

    awsElasticBlockStore 表示一个 AWS 磁盘资源,该资源附加到 kubelet 的主机,然后暴露给 Pod。已弃用:AWSElasticBlockStore 已弃用。所有针对树内 awsElasticBlockStore 类型的操作都重定向到 ebs.csi.aws.com CSI 驱动程序。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/volumes#awselasticblockstore

    *表示 AWS 中的一个持久性磁盘资源。

    AWS EBS 磁盘必须在挂载到容器之前存在。该磁盘还必须与 kubelet 位于相同的 AWS 区域。AWS EBS 磁盘只能挂载为一次读/写。AWS EBS 卷支持所有权管理和 SELinux 重新标记。*

  • azureDisk (AzureDiskVolumeSource)

    azureDisk 表示主机上的 Azure 数据磁盘挂载并绑定到 Pod。已弃用:AzureDisk 已弃用。所有针对树内 azureDisk 类型的操作都重定向到 disk.csi.azure.com CSI 驱动程序。

    AzureDisk 表示主机上的 Azure 数据磁盘挂载并绑定到 Pod。

    • azureDisk.diskName (string), required

      diskName 是 Blob 存储中数据磁盘的名称

    • azureDisk.diskURI (string), required

      diskURI 是 Blob 存储中数据磁盘的 URI

    • azureDisk.cachingMode (string)

      cachingMode 是主机缓存模式:无、只读、读写。

    • azureDisk.fsType (string)

      fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。如果未指定,则隐含推断为“ext4”。

    • azureDisk.kind (string)

      kind 预期值是 Shared:每个存储账户有多个 Blob 磁盘;Dedicated:每个存储账户有单个 Blob 磁盘;Managed:Azure 托管数据磁盘(仅在托管可用性集中)。默认为 Shared。

    • azureDisk.readOnly (boolean)

      readOnly 默认为 false (读/写)。这里的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。

  • azureFile (AzureFilePersistentVolumeSource)

    azureFile 表示主机上的 Azure 文件服务挂载并绑定到 Pod。已弃用:AzureFile 已弃用。所有针对树内 azureFile 类型的操作都重定向到 file.csi.azure.com CSI 驱动程序。

    AzureFile 表示主机上的 Azure 文件服务挂载并绑定到 Pod。

    • azureFile.secretName (string), required

      secretName 是包含 Azure 存储账户名称和密钥的 Secret 名称

    • azureFile.shareName (string), required

      shareName 是 Azure 共享名称

    • azureFile.readOnly (boolean)

      readOnly 默认为 false(读/写)。此处的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。

    • azureFile.secretNamespace (string)

      secretNamespace 是包含 Azure 存储账户名称和密钥的 Secret 所在的命名空间,默认为与 Pod 相同的命名空间

  • cephfs (CephFSPersistentVolumeSource)

    cephFS 表示主机上 Ceph FS 挂载,与 Pod 生命周期共享。已弃用:CephFS 已弃用,且树内 cephfs 类型不再受支持。

    表示与 Pod 生命周期相同的 Ceph 文件系统挂载。Cephfs 卷不支持所有权管理或 SELinux 重新标记。

  • cinder (CinderPersistentVolumeSource)

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

    表示 Openstack 中的 Cinder 卷资源。Cinder 卷必须在挂载到容器之前存在。该卷还必须与 kubelet 位于相同的区域。Cinder 卷支持所有权管理和 SELinux 重新标记。

    • cinder.volumeID (string), required

      volumeID 用于在 cinder 中标识卷。更多信息:https://examples.k8s.io/mysql-cinder-pd/README.md

    • cinder.fsType (string)

      fsType 要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。示例:“ext4”、“xfs”、“ntfs”。如果未指定,则隐含推断为“ext4”。更多信息:https://examples.k8s.io/mysql-cinder-pd/README.md

    • cinder.readOnly (boolean)

      readOnly 是可选的:默认为 false(读/写)。这里的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。更多信息:https://examples.k8s.io/mysql-cinder-pd/README.md

    • cinder.secretRef (SecretReference)

      secretRef 是可选的:指向包含用于连接 OpenStack 的参数的 Secret 对象。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • cinder.secretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • cinder.secretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

  • csi (CSIPersistentVolumeSource)

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

    表示由外部 CSI 卷驱动程序管理的存储

    • csi.driver (string), required

      driver 是用于此卷的驱动程序名称。必需。

    • csi.volumeHandle (string), required

      volumeHandle 是 CSI 卷插件的 CreateVolume 返回的唯一卷名,用于在所有后续调用中引用该卷。必需。

    • csi.controllerExpandSecretRef (SecretReference)

      controllerExpandSecretRef 是对包含敏感信息的 Secret 对象的引用,这些信息将传递给 CSI 驱动程序以完成 CSI ControllerExpandVolume 调用。此字段是可选的,如果不需要 Secret,则可以为空。如果 Secret 对象包含多个 Secret,则所有 Secret 都将被传递。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • csi.controllerExpandSecretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • csi.controllerExpandSecretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

    • csi.controllerPublishSecretRef (SecretReference)

      controllerPublishSecretRef 是对 Secret 对象的引用,该 Secret 对象包含敏感信息,用于传递给 CSI 驱动程序以完成 CSI ControllerPublishVolume 和 ControllerUnpublishVolume 调用。此字段是可选的,如果不需要 Secret,则可以为空。如果 Secret 对象包含多个 Secret,则所有 Secret 都将被传递。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • csi.controllerPublishSecretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • csi.controllerPublishSecretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

    • csi.fsType (string)

      fsType 要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。

    • csi.nodeExpandSecretRef (SecretReference)

      nodeExpandSecretRef 是对 Secret 对象的引用,其中包含要传递给 CSI 驱动程序以完成 CSI NodeExpandVolume 调用的敏感信息。此字段是可选的,如果不需要 Secret,则可以省略。如果 Secret 对象包含多个 Secret,则所有 Secret 都将被传递。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • csi.nodeExpandSecretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • csi.nodeExpandSecretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

    • csi.nodePublishSecretRef (SecretReference)

      nodePublishSecretRef 是对 Secret 对象的引用,该 Secret 对象包含敏感信息,用于传递给 CSI 驱动程序以完成 CSI NodePublishVolume 和 NodeUnpublishVolume 调用。此字段是可选的,如果不需要 Secret,则可以为空。如果 Secret 对象包含多个 Secret,则所有 Secret 都将被传递。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • csi.nodePublishSecretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • csi.nodePublishSecretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

    • csi.nodeStageSecretRef (SecretReference)

      nodeStageSecretRef 是对 Secret 对象的引用,其中包含要传递给 CSI 驱动程序的敏感信息,以完成 CSI NodeStageVolume 和 NodeUnstageVolume 调用。此字段是可选的,如果不需要 Secret,则可以为空。如果 Secret 对象包含多个 Secret,则所有 Secret 都将被传递。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • csi.nodeStageSecretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • csi.nodeStageSecretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

    • csi.readOnly (boolean)

      readOnly 值传递给 ControllerPublishVolumeRequest。默认为 false(读/写)。

    • csi.volumeAttributes (map[string]string)

      要发布的卷的 volumeAttributes。

  • fc (FCVolumeSource)

    fc 表示连接到 kubelet 主机然后暴露给 Pod 的光纤通道资源。

    表示光纤通道卷。光纤通道卷只能挂载为一次读/写。光纤通道卷支持所有权管理和 SELinux 重新标记。

    • fc.fsType (string)

      fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。如果未指定,则隐含推断为“ext4”。

    • fc.lun (int32)

      lun 是可选的:FC 目标 lun 号

    • fc.readOnly (boolean)

      readOnly 是可选的:默认为 false (读/写)。这里的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。

    • fc.targetWWNs ([]string)

      原子性:在合并期间将被替换

      targetWWNs 是可选的:FC 目标全球名称 (WWN)

    • fc.wwids ([]string)

      原子性:在合并期间将被替换

      wwids 可选:FC 卷全球标识符 (wwid) 必须设置 wwids 或 targetWWNs 和 lun 的组合,但不能同时设置两者。

  • flexVolume (FlexPersistentVolumeSource)

    flexVolume 表示使用基于 exec 的插件供应/附加的通用卷资源。已弃用:FlexVolume 已弃用。请考虑改用 CSIDriver。

    FlexPersistentVolumeSource 表示一个通用持久卷资源,该资源使用基于 exec 的插件进行供应/附加。

    • flexVolume.driver (string), required

      driver 是用于此卷的驱动程序名称。

    • flexVolume.fsType (string)

      fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。默认文件系统取决于 FlexVolume 脚本。

    • flexVolume.options (map[string]string)

      options 是可选的:此字段包含任何额外的命令选项。

    • flexVolume.readOnly (boolean)

      readOnly 是可选的:默认为 false (读/写)。此处的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。

    • flexVolume.secretRef (SecretReference)

      secretRef 是可选的:SecretRef 是对 Secret 对象的引用,该对象包含要传递给插件脚本的敏感信息。如果未指定 Secret 对象,则可以为空。如果 Secret 对象包含多个 Secret,则所有 Secret 都将传递给插件脚本。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • flexVolume.secretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • flexVolume.secretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

  • flocker (FlockerVolumeSource)

    flocker 表示一个 Flocker 卷,该卷附加到 kubelet 的主机并暴露给 Pod 使用。这取决于 Flocker 控制服务正在运行。已弃用:Flocker 已弃用,且树内 flocker 类型不再受支持。

    表示由 Flocker 代理挂载的 Flocker 卷。datasetName 和 datasetUUID 中只能设置一个。Flocker 卷不支持所有权管理或 SELinux 重新标记。

    • flocker.datasetName (string)

      datasetName 是存储为元数据中数据集名称的名称 -> Flocker 数据集上的名称应被视为已弃用

    • flocker.datasetUUID (string)

      datasetUUID 是数据集的 UUID。这是 Flocker 数据集的唯一标识符

  • gcePersistentDisk (GCEPersistentDiskVolumeSource)

    gcePersistentDisk 表示一个 GCE 磁盘资源,该资源附加到 kubelet 的主机,然后暴露给 Pod。由管理员提供。已弃用:GCEPersistentDisk 已弃用。所有针对树内 gcePersistentDisk 类型的操作都重定向到 pd.csi.storage.gke.io CSI 驱动程序。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/volumes#gcepersistentdisk

    *表示 Google Compute Engine 中的持久磁盘资源。

    GCE PD 必须在挂载到容器之前存在。该磁盘还必须与 kubelet 位于相同的 GCE 项目和区域。GCE PD 只能挂载为一次读/写或多次只读。GCE PD 支持所有权管理和 SELinux 重新标记。*

  • glusterfs (GlusterfsPersistentVolumeSource)

    glusterfs 表示连接到主机并暴露给 Pod 的 Glusterfs 卷。由管理员提供。已弃用:Glusterfs 已弃用,且树内 glusterfs 类型不再受支持。更多信息:https://examples.k8s.io/volumes/glusterfs/README.md

    表示与 Pod 生命周期相同的 Glusterfs 挂载。Glusterfs 卷不支持所有权管理或 SELinux 重新标记。

  • iscsi (ISCSIPersistentVolumeSource)

    iscsi 表示一个 ISCSI 磁盘资源,该资源附加到 kubelet 的主机,然后暴露给 Pod。由管理员提供。

    ISCSIPersistentVolumeSource 表示一个 ISCSI 磁盘。ISCSI 卷只能挂载为一次读/写。ISCSI 卷支持所有权管理和 SELinux 重新标记。

    • iscsi.iqn (string), required

      iqn 是目标 iSCSI 合格名称。

    • iscsi.lun (int32), required

      lun 是 iSCSI 目标 LUN 号。

    • iscsi.targetPortal (string), required

      targetPortal 是 iSCSI 目标门户。如果端口不是默认端口(通常是 TCP 端口 860 和 3260),则门户可以是 IP 地址或 ip_addr:port。

    • iscsi.chapAuthDiscovery (boolean)

      chapAuthDiscovery 定义是否支持 iSCSI 发现 CHAP 认证

    • iscsi.chapAuthSession (boolean)

      chapAuthSession 定义是否支持 iSCSI 会话 CHAP 认证

    • iscsi.fsType (string)

      fsType 是您要挂载的卷的文件系统类型。提示:确保文件系统类型受主机操作系统支持。示例:“ext4”、“xfs”、“ntfs”。如果未指定,则隐含推断为“ext4”。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/volumes#iscsi

    • iscsi.initiatorName (string)

      initiatorName 是自定义 iSCSI 发起方名称。如果 initiatorName 与 iscsiInterface 同时指定,则将为连接创建新的 iSCSI 接口 <目标门户>:<卷名>。

    • iscsi.iscsiInterface (string)

      iscsiInterface 是使用 iSCSI 传输的接口名称。默认为“default”(tcp)。

    • iscsi.portals ([]string)

      原子性:在合并期间将被替换

      portals 是 iSCSI 目标门户列表。如果端口不是默认端口(通常是 TCP 端口 860 和 3260),则门户可以是 IP 地址或 ip_addr:port。

    • iscsi.readOnly (boolean)

      此处的 readOnly 将强制 VolumeMounts 中的 ReadOnly 设置。默认为 false。

    • iscsi.secretRef (SecretReference)

      secretRef 是用于 iSCSI 目标和发起方认证的 CHAP Secret

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • iscsi.secretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • iscsi.secretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

  • nfs (NFSVolumeSource)

    nfs 表示主机上的 NFS 挂载。由管理员提供。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/volumes#nfs

    表示与 Pod 生命周期相同的 NFS 挂载。NFS 卷不支持所有权管理或 SELinux 重新标记。

  • photonPersistentDisk (PhotonPersistentDiskVolumeSource)

    photonPersistentDisk 表示挂载并附加到 kubelet 主机上的 PhotonController 持久磁盘。已弃用:PhotonPersistentDisk 已弃用,且树内 photonPersistentDisk 类型不再受支持。

    表示 Photon Controller 持久磁盘资源。

    • photonPersistentDisk.pdID (string), required

      pdID 是标识 Photon Controller 持久磁盘的 ID

    • photonPersistentDisk.fsType (string)

      fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。如果未指定,则隐含推断为“ext4”。

  • portworxVolume (PortworxVolumeSource)

    portworxVolume 表示连接并挂载到 kubelet 主机上的 Portworx 卷。已弃用:PortworxVolume 已弃用。当 CSIMigrationPortworx 功能门开启时,所有针对树内 portworxVolume 类型的操作都将重定向到 pxd.portworx.com CSI 驱动程序。

    PortworxVolumeSource 表示 Portworx 卷资源。

    • portworxVolume.volumeID (string), required

      volumeID 唯一标识 Portworx 卷

    • portworxVolume.fsType (string)

      fSType 表示要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”。如果未指定,则隐含推断为“ext4”。

    • portworxVolume.readOnly (boolean)

      readOnly 默认为 false(读/写)。此处的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。

  • quobyte (QuobyteVolumeSource)

    quobyte 表示主机上的 Quobyte 挂载,与 Pod 生命周期共享。已弃用:Quobyte 已弃用,且树内 quobyte 类型不再受支持。

    表示与 Pod 生命周期相同的 Quobyte 挂载。Quobyte 卷不支持所有权管理或 SELinux 重新标记。

    • quobyte.registry (string), required

      registry 表示单个或多个 Quobyte 注册服务,以 host:port 对的字符串形式指定(多个条目用逗号分隔),作为卷的中央注册中心。

    • quobyte.volume (string), required

      volume 是一个字符串,通过名称引用已创建的 Quobyte 卷。

    • quobyte.group (string)

      group 用于将卷访问映射到。默认为无组。

    • quobyte.readOnly (boolean)

      此处的 readOnly 将强制 Quobyte 卷以只读权限挂载。默认为 false。

    • quobyte.tenant (string)

      拥有后端给定 Quobyte 卷的租户。与动态供应的 Quobyte 卷一起使用,值由插件设置。

    • quobyte.user (string)

      user 用于将卷访问映射到。默认为服务账户用户。

  • rbd (RBDPersistentVolumeSource)

    rbd 表示主机上一个 Rados 块设备挂载,与 Pod 生命周期共享。已弃用:RBD 已弃用,且树内 rbd 类型不再受支持。更多信息:https://examples.k8s.io/volumes/rbd/README.md

    表示与 Pod 生命周期相同的 Rados 块设备挂载。RBD 卷支持所有权管理和 SELinux 重新标记。

  • scaleIO (ScaleIOPersistentVolumeSource)

    scaleIO 表示挂载并附加到 Kubernetes 节点上的 ScaleIO 持久卷。已弃用:ScaleIO 已弃用,且树内 scaleIO 类型不再受支持。

    ScaleIOPersistentVolumeSource 表示一个持久的 ScaleIO 卷

    • scaleIO.gateway (string), required

      gateway 是 ScaleIO API 网关的主机地址。

    • scaleIO.secretRef (SecretReference), required

      secretRef 引用 ScaleIO 用户和其他敏感信息的 Secret。如果未提供,登录操作将失败。

      SecretReference 表示一个 Secret 引用。它包含足够的信息以检索任何命名空间中的 Secret

      • scaleIO.secretRef.name (string)

        name 在命名空间内是唯一的,用于引用 Secret 资源。

      • scaleIO.secretRef.namespace (string)

        namespace 定义了 Secret 名称必须唯一的空间。

    • scaleIO.system (string), required

      system 是 ScaleIO 中配置的存储系统名称。

    • scaleIO.fsType (string)

      fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。默认为“xfs”。

    • scaleIO.protectionDomain (string)

      protectionDomain 是配置存储的 ScaleIO 保护域名称。

    • scaleIO.readOnly (boolean)

      readOnly 默认为 false(读/写)。此处的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。

    • scaleIO.sslEnabled (boolean)

      sslEnabled 是启用/禁用与网关的 SSL 通信的标志,默认为 false

    • scaleIO.storageMode (string)

      storageMode 指示卷的存储是 ThickProvisioned 还是 ThinProvisioned。默认为 ThinProvisioned。

    • scaleIO.storagePool (string)

      storagePool 是与保护域关联的 ScaleIO 存储池。

    • scaleIO.volumeName (string)

      volumeName 是已在 ScaleIO 系统中创建的、与此卷源关联的卷的名称。

  • storageos (StorageOSPersistentVolumeSource)

    storageOS 表示一个 StorageOS 卷,该卷附加到 kubelet 的主机并挂载到 Pod 中。已弃用:StorageOS 已弃用,且树内 storageos 类型不再受支持。更多信息:https://examples.k8s.io/volumes/storageos/README.md

    表示一个 StorageOS 持久卷资源。

    • storageos.fsType (string)

      fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。如果未指定,则隐含推断为“ext4”。

    • storageos.readOnly (boolean)

      readOnly 默认为 false(读/写)。此处的 ReadOnly 将强制 VolumeMounts 中的 ReadOnly 设置。

    • storageos.secretRef (ObjectReference)

      secretRef 指定用于获取 StorageOS API 凭据的 Secret。如果未指定,将尝试使用默认值。

    • storageos.volumeName (string)

      volumeName 是 StorageOS 卷的可读名称。卷名称只在命名空间内唯一。

    • storageos.volumeNamespace (string)

      volumeNamespace 指定 StorageOS 中卷的范围。如果没有指定命名空间,将使用 Pod 的命名空间。这允许 Kubernetes 命名范围在 StorageOS 中镜像,以实现更紧密的集成。将 VolumeName 设置为任何名称以覆盖默认行为。如果您未在 StorageOS 中使用命名空间,则设置为“default”。StorageOS 中不存在的命名空间将被创建。

  • vsphereVolume (VsphereVirtualDiskVolumeSource)

    vsphereVolume 表示一个 vSphere 卷,该卷附加并挂载到 kubelet 的主机上。已弃用:VsphereVolume 已弃用。所有针对树内 vsphereVolume 类型的操作都重定向到 csi.vsphere.vmware.com CSI 驱动程序。

    表示一个 vSphere 卷资源。

    • vsphereVolume.volumePath (string), required

      volumePath 是标识 vSphere 卷 vmdk 的路径

    • vsphereVolume.fsType (string)

      fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如“ext4”、“xfs”、“ntfs”。如果未指定,则隐含推断为“ext4”。

    • vsphereVolume.storagePolicyID (string)

      storagePolicyID 是与 StoragePolicyName 关联的存储策略基于管理 (SPBM) 配置文件 ID。

    • vsphereVolume.storagePolicyName (string)

      storagePolicyName 是基于存储策略管理 (SPBM) 的配置文件名称。

PersistentVolumeStatus

PersistentVolumeStatus 是持久卷的当前状态。


  • lastPhaseTransitionTime (Time)

    lastPhaseTransitionTime 是阶段从一个过渡到另一个的时间,并且每次卷阶段过渡时都会自动重置为当前时间。

    Time 是 time.Time 的一个包装器,支持正确地编组到 YAML 和 JSON。提供了 time 包提供的许多工厂方法的包装器。

  • message (string)

    message 是一个人类可读的消息,指示卷处于此状态的详细信息。

  • phase (string)

    phase 指示卷是可用、已绑定到声明,还是由声明释放。更多信息:https://kubernetes.ac.cn/docs/concepts/storage/persistent-volumes#phase

  • reason (string)

    reason 是一个简短的 CamelCase 字符串,描述任何故障,用于机器解析和在 CLI 中整齐显示。

PersistentVolumeList

PersistentVolumeList 是 PersistentVolume 项的列表。


操作


get 读取指定的 PersistentVolume

HTTP 请求

GET /api/v1/persistentvolumes/{name}

参数

  • name (在路径中): string,必填

    PersistentVolume 的名称

  • pretty (在查询中): string

    pretty

响应

200 (PersistentVolume): 成功

401: 未授权

get 读取指定 PersistentVolume 的状态

HTTP 请求

GET /api/v1/persistentvolumes/{name}/status

参数

  • name (在路径中): string,必填

    PersistentVolume 的名称

  • pretty (在查询中): string

    pretty

响应

200 (PersistentVolume): 成功

401: 未授权

list 列出或监视 PersistentVolume 类型的对象

HTTP 请求

GET /api/v1/persistentvolumes

参数

响应

200 (PersistentVolumeList): 成功

401: 未授权

create 创建一个 PersistentVolume

HTTP 请求

POST /api/v1/persistentvolumes

参数

响应

200 (PersistentVolume): 成功

201 (PersistentVolume): 已创建

202 (PersistentVolume): 已接受

401: 未授权

update 替换指定的 PersistentVolume

HTTP 请求

PUT /api/v1/persistentvolumes/{name}

参数

响应

200 (PersistentVolume): 成功

201 (PersistentVolume): 已创建

401: 未授权

update 替换指定 PersistentVolume 的状态

HTTP 请求

PUT /api/v1/persistentvolumes/{name}/status

参数

响应

200 (PersistentVolume): 成功

201 (PersistentVolume): 已创建

401: 未授权

patch 部分更新指定的 PersistentVolume

HTTP 请求

PATCH /api/v1/persistentvolumes/{name}

参数

  • name (在路径中): string,必填

    PersistentVolume 的名称

  • body: Patch,必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (PersistentVolume): 成功

201 (PersistentVolume): 已创建

401: 未授权

patch 部分更新指定 PersistentVolume 的状态

HTTP 请求

PATCH /api/v1/persistentvolumes/{name}/status

参数

  • name (在路径中): string,必填

    PersistentVolume 的名称

  • body: Patch,必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (PersistentVolume): 成功

201 (PersistentVolume): 已创建

401: 未授权

delete 删除一个 PersistentVolume

HTTP 请求

DELETE /api/v1/persistentvolumes/{name}

参数

响应

200 (PersistentVolume): 成功

202 (PersistentVolume): 已接受

401: 未授权

deletecollection 删除 PersistentVolume 集合

HTTP 请求

DELETE /api/v1/persistentvolumes

参数

响应

200 (Status): OK

401: 未授权

本页面是自动生成的。

如果你打算报告此页面存在的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。

上次修改时间:2025 年 9 月 4 日 下午 3:37 PST:更新 v1.34 的 API 资源参考 (3e10e8c195)