CSIStorageCapacity
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
CSIStorageCapacity
CSIStorageCapacity 存储一次 CSI GetCapacity 调用的结果。对于给定的 StorageClass,此对象描述特定拓扑段中可用的容量。在考虑实例化新的 PersistentVolume 时,可以使用此对象。
例如,它可以表达以下信息: - StorageClass "standard" 在 "topology.kubernetes.io/zone=us-east1" 中有 "1234 GiB" 可用容量 - StorageClass "localssd" 在 "kubernetes.io/hostname=knode-abc123" 中有 "10 GiB" 可用容量
以下三种情况都表示某种组合没有可用容量: - 不存在具有合适拓扑和存储类名称的对象 - 存在此类对象,但容量未设置 - 存在此类对象,但容量为零
这些对象的生产者可以决定哪种方法更合适。
当 CSI 驱动程序通过 CSIDriverSpec.StorageCapacity 选择支持容量感知的调度时,kube-scheduler 会使用这些对象。调度器会将 MaximumVolumeSize 与待处理卷的请求大小进行比较,以过滤掉不合适的节点。如果 MaximumVolumeSize 未设置,它将回退到与不那么精确的 Capacity 进行比较。如果 Capacity 也未设置,调度器将假定容量不足并尝试其他节点。
apiVersion: storage.k8s.io/v1
kind: CSIStorageCapacity
metadata (ObjectMeta)
标准对象的元数据。名称没有特殊含义。它必须是 DNS 子域名(允许使用点,最长 253 个字符)。为确保与集群上其他 CSI 驱动程序不冲突,建议使用 csisc-<uuid>、生成的名称或以唯一 CSI 驱动程序名称结尾的反向域名。
对象是命名空间的。
更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
storageClassName (string),必需
storageClassName 表示所报告容量适用的 StorageClass 的名称。它必须满足与 StorageClass 对象名称相同的要求(非空,DNS 子域名)。如果该对象不再存在,则 CSIStorageCapacity 对象已过时,应由其创建者删除。此字段不可变。
capacity (Quantity)
capacity 是 CSI 驱动程序在其 GetCapacityResponse 中报告的值,对应于拓扑和参数与前述字段匹配的 GetCapacityRequest。
其语义目前(CSI 规范 1.2)定义为:可用于配置卷的存储的可用容量,以字节为单位。如果未设置,则表示该信息目前不可用。
maximumVolumeSize (Quantity)
maximumVolumeSize 是 CSI 驱动程序在其 GetCapacityResponse 中报告的值,对应于拓扑和参数与前述字段匹配的 GetCapacityRequest。
自 CSI 规范 1.4.0 起,这被定义为在 CreateVolumeRequest.capacity_range.required_bytes 字段中可用于创建具有与 GetCapacityRequest 中相同参数的卷的最大大小。Kubernetes API 中对应的字段是卷声明中的 ResourceRequirements.Requests。
nodeTopology (LabelSelector)
nodeTopology 定义了哪些节点可以访问报告容量的存储。如果未设置,则集群中的任何节点都无法访问该存储。如果为空,则所有节点都可以访问该存储。此字段不可变。
CSIStorageCapacityList
CSIStorageCapacityList 是 CSIStorageCapacity 对象的集合。
apiVersion: storage.k8s.io/v1
kind: CSIStorageCapacityList
metadata (ListMeta)
标准列表元数据 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]CSIStorageCapacity),必需
items 是 CSIStorageCapacity 对象的列表。
操作
get
读取指定的 CSIStorageCapacity
HTTP 请求
GET /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string,必填
CSIStorageCapacity 的名称
namespace (在路径中): string,必填
pretty (在查询中): string
响应
200 (CSIStorageCapacity):成功
401: 未授权
list
列出或监视 CSIStorageCapacity 类型的对象
HTTP 请求
GET /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
参数
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 (CSIStorageCapacityList):成功
401: 未授权
list
列出或监视 CSIStorageCapacity 类型的对象
HTTP 请求
GET /apis/storage.k8s.io/v1/csistoragecapacities
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (CSIStorageCapacityList):成功
401: 未授权
create
创建 CSIStorageCapacity
HTTP 请求
POST /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
参数
namespace (在路径中): string,必填
body: CSIStorageCapacity,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CSIStorageCapacity):成功
201 (CSIStorageCapacity):已创建
202 (CSIStorageCapacity):已接受
401: 未授权
update
替换指定的 CSIStorageCapacity
HTTP 请求
PUT /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string,必填
CSIStorageCapacity 的名称
namespace (在路径中): string,必填
body: CSIStorageCapacity,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CSIStorageCapacity):成功
201 (CSIStorageCapacity):已创建
401: 未授权
patch
部分更新指定的 CSIStorageCapacity
HTTP 请求
PATCH /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string,必填
CSIStorageCapacity 的名称
namespace (在路径中): string,必填
body: Patch,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (CSIStorageCapacity):成功
201 (CSIStorageCapacity):已创建
401: 未授权
delete
删除 CSIStorageCapacity
HTTP 请求
DELETE /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string,必填
CSIStorageCapacity 的名称
namespace (在路径中): string,必填
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean
pretty (在查询中): string
propagationPolicy (在查询中): string
响应
200 (Status): OK
202 (Status): 已接受
401: 未授权
deletecollection
删除 CSIStorageCapacity 集合
HTTP 请求
DELETE /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
参数
namespace (在路径中): string,必填
body: DeleteOptions
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (Status): OK
401: 未授权
本页面是自动生成的。
如果你打算报告此页面存在的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。