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), 必须
Spec 描述了需要分配的资源的预期属性。它只能在创建 ResourceClaim 时设置一次。
status (ResourceClaimStatus)
Status 描述了资源是否可用以及具有哪些属性。
ResourceClaimSpec
ResourceClaimSpec 定义了如何分配资源。
resourceClassName (string), 必须
ResourceClassName 通过 ResourceClass 的名称引用驱动程序和附加参数,该 ResourceClass 是作为驱动程序部署的一部分创建的。
allocationMode (string)
分配可以立即开始,也可以在 Pod 想要使用资源时开始。 "WaitForFirstConsumer" 是默认值。
parametersRef (ResourceClaimParametersReference)
ParametersRef 引用一个包含任意参数的单独对象,这些参数将在驱动程序为声明分配资源时使用。
该对象必须与 ResourceClaim 位于同一个命名空间中。
ResourceClaimParametersReference 包含足够的信息来让你找到 ResourceClaim 的参数。该对象必须与 ResourceClaim 位于同一个命名空间中。
parametersRef.kind (string), 必须
Kind 是所引用资源的类型。这与参数对象元数据中的值相同,例如 "ConfigMap"。
parametersRef.name (string), 必须
Name 是所引用资源的名称。
parametersRef.apiGroup (string)
APIGroup 是所引用资源的组。对于核心 API,它是空的。这与创建资源时使用的 APIVersion 中的组匹配。
ResourceClaimStatus
ResourceClaimStatus 跟踪资源是否已分配以及最终属性是什么。
allocation (AllocationResult)
Allocation 由资源驱动程序在成功分配资源或一组资源后设置。如果未指定,则资源尚未分配。
allocation.availableOnNodes (NodeSelector)
在资源驱动程序分配资源后,将设置此字段,以告知调度程序可以在哪里调度使用 ResourceClaim 的 Pod。
设置此字段是可选的。如果为 null,则资源在任何地方都可用。
节点选择器表示对一组节点执行一个或多个标签查询结果的并集;也就是说,它表示节点选择器术语表示的选择器的 OR。
allocation.availableOnNodes.nodeSelectorTerms ([]NodeSelectorTerm), 必须
必须。节点选择器术语列表。这些术语是 OR 的。
一个为 null 或空的节点选择器术语不匹配任何对象。它们的 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 匹配。它在分配时设置,用于由其名称与嵌入此 ResourceHandle 的 DriverName 匹配的 kubelet 插件处理。
此字段的最大大小为 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), 必须
Name 是所引用资源的名称。
reservedFor.resource (string), 必须
Resource 是所引用资源的类型,例如 "pods"。
reservedFor.uid (string), 必须
UID 标识资源的唯一化身。
reservedFor.apiGroup (string)
APIGroup 是所引用资源的组。对于核心 API,它是空的。这与创建资源时使用的 APIVersion 中的组匹配。
ResourceClaimList
ResourceClaimList 是声明的集合。
apiVersion: resource.k8s.io/v1alpha2
kind: ResourceClaimList
metadata (ListMeta)
标准列表元数据
items ([]ResourceClaim), 必须
Items 是资源声明列表。
操作
get
读取指定的 ResourceClaim
HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}
参数
响应
200 (ResourceClaim): OK
401: 未经授权
get
读取指定的 ResourceClaim 的状态
HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status
参数
响应
200 (ResourceClaim): OK
401: 未经授权
list
列出或观察 ResourceClaim 类型的对象
HTTP 请求
GET /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims
参数
namespace (在路径中): string, 必须
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, 必须
body: ResourceClaim, 必须
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, 必须
ResourceClaim 的名称
namespace (在路径中): string, 必须
body: ResourceClaim, 必须
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, 必须
ResourceClaim 的名称
namespace (在路径中): string, 必须
body: ResourceClaim, 必须
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, 必须
ResourceClaim 的名称
namespace (在路径中): string, 必须
主体: 补丁,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): 布尔值
pretty (在查询中): string
响应
200 (ResourceClaim): OK
201 (ResourceClaim): 已创建
401: 未经授权
patch
部分更新指定 ResourceClaim 的状态
HTTP 请求
PATCH /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}/status
参数
name (在路径中): string, 必须
ResourceClaim 的名称
namespace (在路径中): string, 必须
主体: 补丁,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): 布尔值
pretty (在查询中): string
响应
200 (ResourceClaim): OK
201 (ResourceClaim): 已创建
401: 未经授权
delete
删除 ResourceClaim
HTTP 请求
DELETE /apis/resource.k8s.io/v1alpha2/namespaces/{namespace}/resourceclaims/{name}
参数
name (在路径中): string, 必须
ResourceClaim 的名称
namespace (在路径中): string, 必须
主体: 删除选项
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, 必须
主体: 删除选项
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): 整数
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): 字符串
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (状态): 正常
401: 未经授权
此页面是自动生成的。
如果您要报告此页面上的问题,请在您的问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。