VolumeAttachment

VolumeAttachment 捕获了将指定卷附加到/从指定节点分离的意图。

apiVersion: storage.k8s.io/v1

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

VolumeAttachment

VolumeAttachment 捕获了将指定卷附加到/从指定节点分离的意图。

VolumeAttachment 对象不是命名空间的。


VolumeAttachmentSpec

VolumeAttachmentSpec 是 VolumeAttachment 请求的规范。


  • attacher (string), required

    attacher 指示必须处理此请求的卷驱动程序的名称。这是 GetPluginName() 返回的名称。

  • nodeName (string), required

    nodeName 表示应将卷附加到的节点。

  • source (VolumeAttachmentSource), required

    source 表示应附加的卷。

    VolumeAttachmentSource 表示应附加的卷。目前只有 PersistentVolumes 可以通过外部附加器附加,未来我们可能也允许 Pod 中的内联卷。只能设置一个成员。

    • source.inlineVolumeSpec (PersistentVolumeSpec)

      inlineVolumeSpec 包含附加由 Pod 的内联 VolumeSource 定义的持久卷所需的所有信息。此字段仅为 CSIMigration 功能填充。它包含从 Pod 的内联 VolumeSource 到 PersistentVolumeSpec 的转换字段。此字段为 Beta 版,仅被启用了 CSIMigration 功能的服务器支持。

    • source.persistentVolumeName (string)

      persistentVolumeName 表示要附加的持久卷的名称。

VolumeAttachmentStatus

VolumeAttachmentStatus 是 VolumeAttachment 请求的状态。


  • attached (boolean), required

    attached 指示卷已成功附加。此字段只能由完成附加操作的实体(即外部附加器)设置。

  • attachError (VolumeError)

    attachError 表示附加操作期间遇到的最后一次错误(如果存在)。此字段只能由完成附加操作的实体(即外部附加器)设置。

    VolumeError 捕获了卷操作期间遇到的错误。

    • attachError.errorCode (int32)

      errorCode 是一个数字 gRPC 代码,表示在附加或分离操作期间遇到的错误。

      这是一个可选的 Beta 字段,需要启用 MutableCSINodeAllocatableCount 功能门才能设置。

    • attachError.message (string)

      message 表示在附加或分离操作期间遇到的错误。此字符串可能会被记录,因此不应包含敏感信息。

    • attachError.time (Time)

      time 表示遇到错误的时间。

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

  • attachmentMetadata (map[string]string)

    attachmentMetadata 填充了附加操作成功后返回的任何信息,这些信息必须传递到后续的 WaitForAttach 或 Mount 调用中。此字段只能由完成附加操作的实体(即外部附加器)设置。

  • detachError (VolumeError)

    detachError 表示分离操作期间遇到的最后一次错误(如果存在)。此字段只能由完成分离操作的实体(即外部分离器)设置。

    VolumeError 捕获了卷操作期间遇到的错误。

    • detachError.errorCode (int32)

      errorCode 是一个数字 gRPC 代码,表示在附加或分离操作期间遇到的错误。

      这是一个可选的 Beta 字段,需要启用 MutableCSINodeAllocatableCount 功能门才能设置。

    • detachError.message (string)

      message 表示在附加或分离操作期间遇到的错误。此字符串可能会被记录,因此不应包含敏感信息。

    • detachError.time (Time)

      time 表示遇到错误的时间。

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

VolumeAttachmentList

VolumeAttachmentList 是 VolumeAttachment 对象的集合。


操作


get 读取指定的 VolumeAttachment

HTTP 请求

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

参数

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

    VolumeAttachment 的名称

  • pretty (在查询中): string

    pretty

响应

200 (VolumeAttachment): OK

401: 未授权

get 读取指定 VolumeAttachment 的状态

HTTP 请求

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

参数

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

    VolumeAttachment 的名称

  • pretty (在查询中): string

    pretty

响应

200 (VolumeAttachment): OK

401: 未授权

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

HTTP 请求

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

参数

响应

200 (VolumeAttachmentList): OK

401: 未授权

create 创建一个 VolumeAttachment

HTTP 请求

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

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

202 (VolumeAttachment): Accepted

401: 未授权

update 替换指定的 VolumeAttachment

HTTP 请求

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

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: 未授权

update 替换指定 VolumeAttachment 的状态

HTTP 请求

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

参数

响应

200 (VolumeAttachment): OK

201 (VolumeAttachment): Created

401: 未授权

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: 未授权

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: 未授权

delete 删除一个 VolumeAttachment

HTTP 请求

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

参数

响应

200 (VolumeAttachment): OK

202 (VolumeAttachment): Accepted

401: 未授权

deletecollection 删除 VolumeAttachment 集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: 未授权

本页面是自动生成的。

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

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