您正在查看 Kubernetes 版本的文档: v1.24

Kubernetes v1.24 版本的文档已不再维护。您现在看到的版本来自于一份静态的快照。如需查阅最新文档,请点击 最新版本。

VolumeAttachment

VolumeAttachment 抓取将指定卷挂接到指定节点或从指定节点解除挂接指定卷的意图。

apiVersion: storage.k8s.io/v1

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

VolumeAttachment

VolumeAttachment 抓取将指定卷挂接到指定节点或从指定节点解除挂接指定卷的意图。

VolumeAttachment 对象未划分命名空间。


  • apiVersion: storage.k8s.io/v1
  • kind: VolumeAttachment
  • status (VolumeAttachmentStatus) VolumeAttachment 请求的状态。由完成挂接或解除挂接操作的实体(即外部挂接器)进行填充。

VolumeAttachmentSpec

VolumeAttachmentSpec 是 VolumeAttachment 请求的规约。


  • attacher (string),必需 attacher 表示必须处理此请求的卷驱动的名称。这是由 GetPluginName() 返回的名称。

  • nodeName (string),必需 卷应挂接到的节点。

  • source (VolumeAttachmentSource),必需 source 表示应挂接的卷。

    VolumeAttachmentSource 表示应挂接的卷。现在只能通过外部挂接器挂接 PersistenVolume, 将来我们可能还允许 Pod 中的内联卷。只能设置一个成员。

    • source.inlineVolumeSpec (PersistentVolumeSpec)

      inlineVolumeSpec 包含挂接由 Pod 的内联 VolumeSource 定义的持久卷时所有必需的信息。 仅为 CSIMigation 功能填充此字段。 它包含从 Pod 的内联 VolumeSource 转换为 PersistentVolumeSpec 的字段。 此字段处于 beta 阶段,且只有启用 CSIMigration 功能的服务器才能使用此字段。

    • source.persistentVolumeName (string) 要挂接的持久卷的名称。

VolumeAttachmentStatus

VolumeAttachmentStatus 是 VolumeAttachment 请求的状态。


  • attached (boolean),必需 表示卷被成功挂接。此字段只能由完成挂接操作的实体(例如外部挂接器)进行设置。
  • attachError (VolumeError) 挂接操作期间遇到的最后一个错误,如果有。 此字段只能由完成挂接操作的实体(例如外部挂接器)进行设置。

    VolumeError 抓取卷操作期间遇到的一个错误。

    • attachError.message (string) 此字符串详细说明挂接或解除挂接操作期间遇到的错误。 此字符串可以放入日志,因此它不应包含敏感信息。

    • attachError.time (Time) 遇到错误的时间。

      time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。

  • attachmentMetadata (map[string]string) 成功挂接时,此字段将由挂接操作返回的任何信息进行填充, 这些信息必须传递到后续的 WaitForAttach 或 Mount 调用中。 此字段只能由完成挂接操作的实体(例如外部挂接器)进行设置。
  • detachError (VolumeError) 解除挂接操作期间遇到的最后一个错误,如果有。 此字段只能由完成解除挂接操作的实体(例如外部挂接器)进行设置。

    VolumeError 抓取卷操作期间遇到的一个错误。

    • detachError.message (string) 此字符串详细说明挂接或解除挂接操作期间遇到的错误。 此字符串可以放入日志,因此它不应包含敏感信息。

    • detachError.time (Time) 遇到错误的时间。

      time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。

VolumeAttachmentList

VolumeAttachmentList 是 VolumeAttachment 对象的集合。


  • apiVersion: storage.k8s.io/v1
  • kind: VolumeAttachmentList

操作


get 读取指定的 VolumeAttachment

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

  • name (路径参数): string,必需 VolumeAttachment 的名称

  • pretty (查询参数): string pretty

响应

200 (VolumeAttachment): OK

401: Unauthorized

get 读取指定的 VolumeAttachment 的状态

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattachments/{name}/status

参数

  • name (路径参数): string,必需 VolumeAttachment 的名称

  • pretty (查询参数): string pretty

响应

200 (VolumeAttachment): OK

401: Unauthorized

list 列出或观测类别为 VolumeAttachment 的对象

HTTP 请求

GET /apis/storage.k8s.io/v1/volumeattachments

参数

响应

200 (VolumeAttachmentList): OK

401: Unauthorized

create 创建 VolumeAttachment

HTTP 请求

POST /apis/storage.k8s.io/v1/volumeattachments

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

202 (VolumeAttachment): Accepted

401: Unauthorized

update 替换指定的 VolumeAttachment

HTTP 请求

PUT /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

  • name (路径参数): string,必需 VolumeAttachment 的名称

  • body: VolumeAttachment,必需

  • dryRun (查询参数): string dryRun

  • fieldManager (查询参数): string fieldManager

  • fieldValidation (查询参数): string fieldValidation

  • pretty (查询参数): string pretty

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

update 替换指定的 VolumeAttachment 的状态

HTTP 请求

PUT /apis/storage.k8s.io/v1/volumeattachments/{name}/status

参数

  • name (路径参数): string,必需 VolumeAttachment 的名称

  • body: VolumeAttachment,必需

  • dryRun (查询参数): string dryRun

  • fieldManager (查询参数): string fieldManager

  • fieldValidation (查询参数): string fieldValidation

  • pretty (查询参数): string pretty

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

patch 部分更新指定的 VolumeAttachment

HTTP 请求

PATCH /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

  • name (路径参数): string,必需 VolumeAttachment 的名称

  • body: Patch,必需

  • dryRun (查询参数): string dryRun

  • fieldManager (查询参数): string fieldManager

  • fieldValidation (查询参数): string fieldValidation

  • force (查询参数): boolean force

  • pretty (查询参数): string pretty

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

patch 部分更新指定的 VolumeAttachment 的状态

HTTP 请求

PATCH /apis/storage.k8s.io/v1/volumeattachments/{name}/status

参数

  • name (路径参数): string,必需 VolumeAttachment 的名称

  • body: Patch,必需

  • dryRun (查询参数): string dryRun

  • fieldManager (查询参数): string fieldManager

  • fieldValidation (查询参数): string fieldValidation

  • force (查询参数): boolean force

  • pretty (查询参数): string pretty

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: Unauthorized

delete 删除 VolumeAttachment

HTTP 请求

DELETE /apis/storage.k8s.io/v1/volumeattachments/{name}

参数

响应

200 (VolumeAttachment): OK

202 (VolumeAttachment): Accepted

401: Unauthorized

deletecollection 删除 VolumeAttachment 的集合

HTTP 请求

DELETE /apis/storage.k8s.io/v1/volumeattachments

参数

响应

200 (Status): OK

401: Unauthorized

最后修改 June 16, 2022 at 10:32 PM PST: [zh] resyn ref-k8s-api-config: volume-attachment-v1.md (9f5c01ca6f)