ResourceClaim v1alpha2
apiVersion: resource.k8s.io/v1alpha2
import "k8s.io/api/resource/v1alpha2"
ResourceClaim
ResourceClaim 描述了资源使用者需要哪些资源。它的状态跟踪资源是否已分配以及结果属性是什么。
这是一个 alpha 类型,需要启用 DynamicResourceAllocation 功能门。
apiVersion: resource.k8s.io/v1alpha2
kind: ResourceClaim
metadata (ObjectMeta)
标准对象元数据
spec (ResourceClaimSpec), required
Spec 描述了要分配的资源的所需属性。它只能在创建 ResourceClaim 时设置一次。
status (ResourceClaimStatus)
Status 描述了资源是否可用以及具有哪些属性。
ResourceClaimSpec
ResourceClaimSpec 定义了如何分配资源。
resourceClassName (string), required
ResourceClassName 通过 ResourceClass 的名称引用驱动程序和附加参数,该 ResourceClass 是作为驱动程序部署的一部分创建的。
allocationMode (string)
分配可以立即开始,也可以在 Pod 想要使用资源时开始。 "WaitForFirstConsumer" 是默认值。
parametersRef (ResourceClaimParametersReference)
ParametersRef 引用一个具有任意参数的单独对象,这些参数将在驱动程序为声明分配资源时使用。
该对象必须与 ResourceClaim 位于同一个命名空间。
ResourceClaimParametersReference 包含足够的信息来让您找到 ResourceClaim 的参数。该对象必须与 ResourceClaim 位于同一个命名空间。
parametersRef.kind (string), required
Kind 是被引用的资源类型。这与参数对象元数据中的值相同,例如 "ConfigMap"。
parametersRef.name (string), required
Name 是被引用的资源的名称。
parametersRef.apiGroup (string)
APIGroup 是被引用的资源的组。对于核心 API,它为空。这与在创建资源时使用的 APIVersion 中的组匹配。
ResourceClaimStatus
ResourceClaimStatus 跟踪资源是否已分配以及结果属性是什么。
allocation (AllocationResult)
Allocation 由资源驱动程序在成功分配资源或一组资源后设置。如果未指定此项,则资源尚未分配。
allocation.availableOnNodes (NodeSelector)
在资源驱动程序分配资源后,此字段将由资源驱动程序设置,以通知调度程序它可以在哪里调度使用 ResourceClaim 的 Pod。
设置此字段是可选的。如果为 null,则资源在任何地方都可用。
节点选择器表示对一组节点执行一个或多个标签查询结果的并集;也就是说,它表示由节点选择器项表示的选择器的 OR。
allocation.availableOnNodes.nodeSelectorTerms ([]NodeSelectorTerm), required
必需。节点选择器项列表。这些项是 OR 的。
空或空的节点选择器项不匹配任何对象。它们的 requirement 是 AND 的。TopologySelectorTerm 类型实现了 NodeSelectorTerm 的子集。
allocation.availableOnNodes.nodeSelectorTerms.matchExpressions ([]NodeSelectorRequirement)
节点标签的节点选择器要求列表。
allocation.availableOnNodes.nodeSelectorTerms.matchFields ([]NodeSelectorRequirement)
节点字段的节点选择器要求列表。
allocation.resourceHandles ([]ResourceHandle)
原子:将在合并期间替换
ResourceHandles 包含与分配相关的状态,该状态应在声明的整个生命周期内维护。每个 ResourceHandle 都包含在它到达节点后应传递给特定 kubelet 插件的数据。这些数据由驱动程序在成功分配后返回,并且对 Kubernetes 是不透明的。如果需要,驱动程序文档可能会向用户解释如何解释这些数据。
设置此字段是可选的。它最多有 32 个条目。如果为 null(或为空),则假定此分配将由单个 kubelet 插件处理,并且没有附加 ResourceHandle 数据。调用的 kubelet 插件的名称将与嵌入此 AllocationResult 的 ResourceClaimStatus 中设置的 DriverName 匹配。
ResourceHandle 为特定 kubelet 插件处理保留不透明的资源数据。
allocation.resourceHandles.data (string)
Data 包含与此 ResourceHandle 关联的不透明数据。它由资源驱动程序的控制器组件设置,其名称与嵌入此 ResourceHandle 的 ResourceClaimStatus 中设置的 DriverName 匹配。它在分配时设置,旨在由 kubelet 插件处理,其名称与嵌入此 ResourceHandle 的 DriverName 匹配。
此字段的最大大小为 16KiB。这将来可能会增加,但不会减少。
allocation.resourceHandles.driverName (string)
DriverName 指定资源驱动程序的名称,其 kubelet 插件应在它到达节点后被调用以处理此 ResourceHandle 的数据。这可能与嵌入此 ResourceHandle 的 ResourceClaimStatus 中设置的 DriverName 不同。
allocation.shareable (boolean)
Shareable 确定资源是否支持一次多个使用者。
deallocationRequested (boolean)
DeallocationRequested 指示要取消分配 ResourceClaim。
然后,驱动程序必须取消分配此声明并重置该字段,并清除 Allocation 字段。
在设置 DeallocationRequested 时,不得向 ReservedFor 添加新的使用者。
driverName (string)
DriverName 是分配开始时 ResourceClass 中驱动程序名称的副本。
reservedFor ([]ResourceClaimConsumerReference)
Map:在合并期间将保留键 uid 上的唯一值
ReservedFor 指示哪些实体当前被允许使用该声明。引用未为该 Pod 保留的 ResourceClaim 的 Pod 不会启动。
最多可以有 32 个这样的保留。这将来可能会增加,但不会减少。
ResourceClaimConsumerReference 包含足够的信息来让您找到 ResourceClaim 的使用者。用户必须是与 ResourceClaim 位于同一个命名空间的资源。
reservedFor.name (string), required
Name 是被引用的资源的名称。
reservedFor.resource (string), required
Resource 是被引用的资源类型,例如 "pods"。
reservedFor.uid (string), required
UID 标识资源的唯一化身。
reservedFor.apiGroup (string)
APIGroup 是被引用的资源的组。对于核心 API,它为空。这与在创建资源时使用的 APIVersion 中的组匹配。
ResourceClaimList
ResourceClaimList 是声明的集合。
apiVersion: resource.k8s.io/v1alpha2
kind: ResourceClaimList
metadata (ListMeta)
标准列表元数据
items ([]ResourceClaim), required
Items 是资源声明列表。
操作
get
读取指定的 ResourceClaim
HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}
参数
name (在路径中): string, required
ResourceClaim 的名称
namespace (在路径中): string, required
pretty (在查询中): string
响应
200 (ResourceClaim): OK
401: 未经授权
get
读取指定 ResourceClaim 的状态
HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status
参数
name (在路径中): string, required
ResourceClaim 的名称
namespace (在路径中): string, required
pretty (在查询中): string
响应
200 (ResourceClaim): OK
401: 未经授权
list
列出或观察 ResourceClaim 类型的对象
HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims
参数
namespace (在路径中): string, required
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (ResourceClaimList): OK
401: 未经授权
list
列出或观察 ResourceClaim 类型的对象
HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/resourceclaims
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (ResourceClaimList): OK
401: 未经授权
create
创建一个 ResourceClaim
HTTP 请求
POST /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims
参数
namespace (在路径中): string, required
body: ResourceClaim, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (ResourceClaim): OK
201 (ResourceClaim): 已创建
202 (ResourceClaim): 已接受
401: 未经授权
update
替换指定的 ResourceClaim
HTTP 请求
PUT /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}
参数
name (在路径中): string, required
ResourceClaim 的名称
namespace (在路径中): string, required
body: ResourceClaim, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (ResourceClaim): OK
201 (ResourceClaim): 已创建
401: 未经授权
update
替换指定 ResourceClaim 的状态
HTTP 请求
PUT /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status
参数
name (在路径中): string, required
ResourceClaim 的名称
namespace (在路径中): string, required
body: ResourceClaim, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (ResourceClaim): OK
201 (ResourceClaim): 已创建
401: 未经授权
patch
部分更新指定的 ResourceClaim
HTTP 请求
PATCH /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}
参数
name (在路径中): string, required
ResourceClaim 的名称
namespace (在路径中): string, required
body: Patch, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (ResourceClaim): OK
201 (ResourceClaim): 已创建
401: 未经授权
patch
部分更新指定 ResourceClaim 的状态
HTTP 请求
PATCH /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status
参数
name (在路径中): string, required
ResourceClaim 的名称
namespace (在路径中): string, required
body: Patch, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (ResourceClaim): OK
201 (ResourceClaim): 已创建
401: 未经授权
delete
删除 ResourceClaim
HTTP 请求
DELETE /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}
参数
name (在路径中): string, required
ResourceClaim 的名称
namespace (在路径中): string, required
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): 整数
pretty (在查询中): string
propagationPolicy (在查询中): 字符串
响应
200 (ResourceClaim): OK
202 (ResourceClaim): 已接受
401: 未经授权
deletecollection
删除 ResourceClaim 集合
HTTP 请求
DELETE /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims
参数
namespace (在路径中): string, required
body: DeleteOptions
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): 整数
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): 字符串
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (Status): 正常
401: 未经授权
此页面是自动生成的。
如果您要报告此页面存在问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。