CSIStorageCapacity
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
CSIStorageCapacity
CSIStorageCapacity 存储一次 CSI GetCapacity 调用的结果。对于给定的 StorageClass,它描述了特定拓扑段中可用的容量。这可以在考虑在哪里实例化新的 PersistentVolumes 时使用。
例如,这可以表示以下内容: - StorageClass "standard" 在 "topology.kubernetes.io/zone=us-east1" 中有 "1234 GiB" 可用 - StorageClass "localssd" 在 "kubernetes.io/hostname=knode-abc123" 中有 "10 GiB" 可用
以下三种情况都暗示着某种组合没有可用容量: - 不存在具有合适拓扑和 StorageClass 名称的对象 - 存在这样的对象,但容量未设置 - 存在这样的对象,但容量为零
这些对象的生产者可以决定哪种方法更合适。
它们被 kube-scheduler 在 CSI 驱动程序使用 CSIDriverSpec.StorageCapacity 选择容量感知调度时使用。调度器将 MaximumVolumeSize 与待处理卷的请求大小进行比较,以过滤掉不合适的节点。如果 MaximumVolumeSize 未设置,它将回退到与不太精确的 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), required
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), required
Map: 在合并期间将保留键名上的唯一值
items 是 CSIStorageCapacity 对象的列表。
操作
get
读取指定的 CSIStorageCapacity
HTTP 请求
GET /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string, required
CSIStorageCapacity 的名称
namespace (在路径中): string, required
pretty (在查询中): string
响应
200 (CSIStorageCapacity): OK
401: 未授权
list
列出或监视 CSIStorageCapacity 类型的对象
HTTP 请求
GET /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
参数
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 (CSIStorageCapacityList): OK
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): OK
401: 未授权
create
创建一个 CSIStorageCapacity
HTTP 请求
POST /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
参数
namespace (在路径中): string, required
body: CSIStorageCapacity, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CSIStorageCapacity): OK
201 (CSIStorageCapacity): 已创建
202 (CSIStorageCapacity): 已接受
401: 未授权
update
替换指定的 CSIStorageCapacity
HTTP 请求
PUT /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string, required
CSIStorageCapacity 的名称
namespace (在路径中): string, required
body: CSIStorageCapacity, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CSIStorageCapacity): OK
201 (CSIStorageCapacity): 已创建
401: 未授权
patch
部分更新指定的 CSIStorageCapacity
HTTP 请求
PATCH /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string, required
CSIStorageCapacity 的名称
namespace (在路径中): string, required
body: Patch, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (在查询中): boolean
pretty (在查询中): string
响应
200 (CSIStorageCapacity): OK
201 (CSIStorageCapacity): 已创建
401: 未授权
delete
删除 CSIStorageCapacity
HTTP 请求
DELETE /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
参数
name (在路径中): string, required
CSIStorageCapacity 的名称
namespace (在路径中): string, required
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
响应
200 (Status): OK
202 (Status): 已接受
401: 未授权
deletecollection
删除 CSIStorageCapacity 的集合
HTTP 请求
DELETE /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
参数
namespace (在路径中): string, required
body: DeleteOptions
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (在查询中): integer
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (Status): OK
401: 未授权
此页面是自动生成的。
如果您计划报告此页面的问题,请在您的问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。