website/content/zh-cn/docs/reference/kubernetes-api/workload-resources/resource-claim-template-v1a...

26 KiB
Raw Blame History

api_metadata content_type description title weight
apiVersion import kind
resource.k8s.io/v1alpha2 k8s.io/api/resource/v1alpha2 ResourceClaimTemplate
api_reference ResourceClaimTemplate 用于生成 ResourceClaim 对象。 ResourceClaimTemplate v1alpha2 16

apiVersion: resource.k8s.io/v1alpha2

import "k8s.io/api/resource/v1alpha2"

ResourceClaimTemplate

ResourceClaimTemplate 用于生成 ResourceClaim 对象。


  • apiVersion: resource.k8s.io/v1alpha2

  • kind: ResourceClaimTemplate

  • metadata (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta)

    标准的对象元数据。

  • spec (<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplateSpec" >}}">ResourceClaimTemplateSpec), 必需

    描述要生成的 ResourceClaim。

    该字段是不可变的。当需要时,控制平面将为 Pod 创建一个 ResourceClaim然后不再对其进行更新。

ResourceClaimTemplateSpec

ResourceClaimTemplateSpec 包含针对 ResourceClaim 的元数据和字段。


spec* (<a href="{{< ref "#ResourceClaimTemplateSpec" >}}">ResourceClaimSpec), 必需

ResourceClaim 的规约。整个内容将不加修改地复制到从模板创建的 ResourceClaim 中。 与 ResourceClaim 中相同的字段在此处也是有效的。

  • metadata (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta)

    ObjectMeta 可以包含创建 PVC 时将要复制到其中的标签和注解。 不允许设置其他字段,并且即便设置了也会在验证期间被拒绝。

ResourceClaimTemplateList

ResourceClaimTemplateList 是申领模板的集合。


  • apiVersion: resource.k8s.io/v1alpha2

  • kind: ResourceClaimTemplateList

  • metadata (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta)

    标准的列表元数据。

  • items ([]<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate), 必需

    items 是资源申领模板的列表。

操作


get 读取指定的 ResourceClaimTemplate

HTTP 请求

GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

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

    name of the ResourceClaimTemplate

  • namespace (路径参数): string, 必需

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

  • pretty (查询参数): string

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

响应

200 (<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): OK

401: Unauthorized

list 列出或监视 ResourceClaimTemplate 类别的对象

HTTP 请求

GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates

参数

  • namespace (路径参数): string, 必需

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

  • 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 "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplateList" >}}">ResourceClaimTemplateList): OK

401: Unauthorized

list 列出或监视 ResourceClaimTemplate 类别的对象

HTTP 请求

GET /apis/resource.k8s.io/v1alpha2/resourceclaimtemplates

参数

  • 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 "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplateList" >}}">ResourceClaimTemplateList): OK

401: Unauthorized

create 创建 ResourceClaimTemplate

HTTP 请求

POST /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates

参数

  • namespace (路径参数): string, 必需

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

  • body: <a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate, 必需

  • 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 "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): OK

201 (<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): Created

202 (<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): Accepted

401: Unauthorized

update 替换指定的 ResourceClaimTemplate

HTTP 请求

PUT /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

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

    name of the ResourceClaimTemplate

  • namespace (路径参数): string, 必需

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

  • body: <a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate, 必需

  • 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 "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): OK

201 (<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): Created

401: Unauthorized

patch 部分更新指定的 ResourceClaimTemplate

HTTP 请求

PATCH /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

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

    name of the ResourceClaimTemplate

  • namespace (路径参数): string, 必需

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

  • 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 "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): OK

201 (<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): Created

401: Unauthorized

delete 删除 ResourceClaimTemplate

HTTP 请求

DELETE /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates/{name}

参数

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

    name of the ResourceClaimTemplate

  • namespace (路径参数): string, 必需

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

  • 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 "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): OK

202 (<a href="{{< ref "../workload-resources/resource-claim-template-v1alpha2#ResourceClaimTemplate" >}}">ResourceClaimTemplate): Accepted

401: Unauthorized

deletecollection 删除 ResourceClaimTemplate 的集合

HTTP 请求

DELETE /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaimtemplates

参数

  • namespace (路径参数): string, 必需

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

  • 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