website/content/zh-cn/docs/reference/kubernetes-api/config-and-storage-resources/volume-attachment-v1.md

27 KiB
Raw Blame History

api_metadata content_type description title weight
apiVersion import kind
storage.k8s.io/v1 k8s.io/api/storage/v1 VolumeAttachment
api_reference VolumeAttachment 抓取将指定卷挂接到指定节点或从指定节点解除挂接指定卷的意图。 VolumeAttachment 7

apiVersion: storage.k8s.io/v1

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

VolumeAttachment

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

VolumeAttachment 对象未划分命名空间。


  • apiVersion: storage.k8s.io/v1

  • kind: VolumeAttachment

  • status (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachmentStatus" >}}">VolumeAttachmentStatus)

    status 表示 VolumeAttachment 请求的状态。由完成挂接或解除挂接操作的实体(即外部挂接器)进行填充。

VolumeAttachmentSpec

VolumeAttachmentSpec 是 VolumeAttachment 请求的规约。


  • attacher (string),必需

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

  • nodeName (string),必需

    nodeName 表示卷应挂接到的节点。

  • source (VolumeAttachmentSource),必需

    source 表示应挂接的卷。

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

    • source.inlineVolumeSpec (<a href="{{< ref "../config-and-storage-resources/persistent-volume-v1#PersistentVolumeSpec" >}}">PersistentVolumeSpec)

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

    • source.persistentVolumeName (string)

      persistentVolumeName 是要挂接的持久卷的名称。

VolumeAttachmentStatus

VolumeAttachmentStatus 是 VolumeAttachment 请求的状态。


  • attached (boolean),必需

    attached 表示卷被成功挂接。此字段只能由完成挂接操作的实体(例如外部挂接器)进行设置。

  • attachError (VolumeError)

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

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

    • attachError.message (string)

      message 表示挂接或解除挂接操作期间遇到的错误。 此字符串可以放入日志,因此它不应包含敏感信息。

    • attachError.time (Time)

      遇到错误的时间。

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

  • attachmentMetadata (map[string]string)

    成功挂接时attachmentMetadata 字段将由挂接操作返回的任何信息进行填充, 这些信息必须传递到后续的 WaitForAttach 或 Mount 调用中。 此字段只能由完成挂接操作的实体(例如外部挂接器)进行设置。

  • detachError (VolumeError)

    detachError 表示解除挂接操作期间遇到的最后一个错误,如果有。 此字段只能由完成解除挂接操作的实体(例如外部挂接器)进行设置。

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

    • detachError.message (string)

      message 表示挂接或解除挂接操作期间遇到的错误。 此字符串可以放入日志,因此它不应包含敏感信息。

    • detachError.time (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

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

401: Unauthorized

get 读取指定的 VolumeAttachment 的状态

HTTP 请求

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

参数

  • name (路径参数): string必需

    VolumeAttachment 的名称

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

401: Unauthorized

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

HTTP 请求

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

参数

  • allowWatchBookmarks (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachmentList" >}}">VolumeAttachmentList): OK

401: Unauthorized

create 创建 VolumeAttachment

HTTP 请求

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

参数

  • body: <a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

201 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): Created

202 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): Accepted

401: Unauthorized

update 替换指定的 VolumeAttachment

HTTP 请求

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

参数

  • name (路径参数): string必需

    VolumeAttachment 的名称

  • body: <a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

201 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): Created

401: Unauthorized

update 替换指定的 VolumeAttachment 的状态

HTTP 请求

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

参数

  • name (路径参数): string必需

    VolumeAttachment 的名称

  • body: <a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

201 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): Created

401: Unauthorized

patch 部分更新指定的 VolumeAttachment

HTTP 请求

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

参数

  • name (路径参数): string必需

    VolumeAttachment 的名称

  • body: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • force (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

201 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): Created

401: Unauthorized

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

HTTP 请求

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

参数

  • name (路径参数): string必需

    VolumeAttachment 的名称

  • body: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch必需

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • force (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

201 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): Created

401: Unauthorized

delete 删除 VolumeAttachment

HTTP 请求

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

参数

  • name (路径参数): string必需

    VolumeAttachment 的名称

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • gracePeriodSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

响应

200 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): OK

202 (<a href="{{< ref "../config-and-storage-resources/volume-attachment-v1#VolumeAttachment" >}}">VolumeAttachment): Accepted

401: Unauthorized

deletecollection 删除 VolumeAttachment 的集合

HTTP 请求

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

参数

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • continue (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • dryRun (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • gracePeriodSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • labelSelector (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

  • resourceVersion (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (查询参数): string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds (查询参数): integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

401: Unauthorized