ResourceQuota

ResourceQuota 为每个命名空间设置并强制执行聚合配额限制。

apiVersion: v1

import "k8s.io/api/core/v1"

ResourceQuota

ResourceQuota 为每个命名空间设置并强制执行聚合配额限制


ResourceQuotaSpec

ResourceQuotaSpec 定义了要为配额强制执行的期望硬性限制。


  • hard (map[string]Quantity)

    hard 是为每个命名资源设置的期望硬性限制集。更多信息:https://kubernetes.ac.cn/docs/concepts/policy/resource-quotas/

  • scopeSelector (ScopeSelector)

    scopeSelector 也是一组过滤器,与 scopes 类似,必须匹配配额所跟踪的每个对象,但使用 ScopeSelectorOperator 与可能的值结合表达。要匹配一个资源,scopes 和 scopeSelector (如果 spec 中指定) 都必须匹配。

    范围选择器表示由作用域资源选择器需求表示的选择器的 AND 组合。

    • scopeSelector.matchExpressions ([]ScopedResourceSelectorRequirement)

      Atomic: 合并期间将被替换

      按资源范围列出的范围选择器需求列表。

      作用域资源选择器需求是一个选择器,包含值、作用域名称以及关联作用域名称和值的操作符。

      • scopeSelector.matchExpressions.operator (string), required

        表示作用域与一组值之间的关系。有效操作符为 In, NotIn, Exists, DoesNotExist。

      • scopeSelector.matchExpressions.scopeName (string), required

        选择器适用的作用域名称。

      • scopeSelector.matchExpressions.values ([]string)

        Atomic: 合并期间将被替换

        一个字符串值数组。如果操作符是 In 或 NotIn,values 数组必须非空。如果操作符是 Exists 或 DoesNotExist,values 数组必须为空。在策略性合并补丁期间,此数组将被替换。

  • scopes ([]string)

    Atomic: 合并期间将被替换

    一组过滤器,必须匹配配额所跟踪的每个对象。如果未指定,则配额匹配所有对象。

ResourceQuotaStatus

ResourceQuotaStatus 定义了强制执行的硬性限制和观察到的使用情况。


ResourceQuotaList

ResourceQuotaList 是 ResourceQuota 项的列表。


操作


get 读取指定的 ResourceQuota

HTTP 请求

GET /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

  • name (在路径中): string, required

    ResourceQuota 的名称

  • namespace (在路径中): string, required

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): 成功 (OK)

401: 未授权 (Unauthorized)

get 读取指定的 ResourceQuota 的状态

HTTP 请求

GET /api/v1/namespaces/{namespace}/resourcequotas/{name}/status

参数

  • name (在路径中): string, required

    ResourceQuota 的名称

  • namespace (在路径中): string, required

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): 成功 (OK)

401: 未授权 (Unauthorized)

list 列出或监听 ResourceQuota 类型的对象

HTTP 请求

GET /api/v1/namespaces/{namespace}/resourcequotas

参数

响应

200 (ResourceQuotaList): 成功 (OK)

401: 未授权 (Unauthorized)

list 列出或监听 ResourceQuota 类型的对象

HTTP 请求

GET /api/v1/resourcequotas

参数

响应

200 (ResourceQuotaList): 成功 (OK)

401: 未授权 (Unauthorized)

create 创建一个 ResourceQuota

HTTP 请求

POST /api/v1/namespaces/{namespace}/resourcequotas

参数

响应

200 (ResourceQuota): 成功 (OK)

201 (ResourceQuota): 已创建 (Created)

202 (ResourceQuota): 已接受 (Accepted)

401: 未授权 (Unauthorized)

update 替换指定的 ResourceQuota

HTTP 请求

PUT /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

响应

200 (ResourceQuota): 成功 (OK)

201 (ResourceQuota): 已创建 (Created)

401: 未授权 (Unauthorized)

update 替换指定的 ResourceQuota 的状态

HTTP 请求

PUT /api/v1/namespaces/{namespace}/resourcequotas/{name}/status

参数

响应

200 (ResourceQuota): 成功 (OK)

201 (ResourceQuota): 已创建 (Created)

401: 未授权 (Unauthorized)

patch 部分更新指定的 ResourceQuota

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

  • name (在路径中): string, required

    ResourceQuota 的名称

  • namespace (在路径中): string, required

    命名空间

  • body: Patch, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): 成功 (OK)

201 (ResourceQuota): 已创建 (Created)

401: 未授权 (Unauthorized)

patch 部分更新指定的 ResourceQuota 的状态

HTTP 请求

PATCH /api/v1/namespaces/{namespace}/resourcequotas/{name}/status

参数

  • name (在路径中): string, required

    ResourceQuota 的名称

  • namespace (在路径中): string, required

    命名空间

  • body: Patch, required

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): 成功 (OK)

201 (ResourceQuota): 已创建 (Created)

401: 未授权 (Unauthorized)

delete 删除一个 ResourceQuota

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/resourcequotas/{name}

参数

响应

200 (ResourceQuota): 成功 (OK)

202 (ResourceQuota): 已接受 (Accepted)

401: 未授权 (Unauthorized)

deletecollection 删除 ResourceQuota 集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/resourcequotas

参数

响应

200 (Status): 成功 (OK)

401: 未授权 (Unauthorized)

本页面是自动生成的。

如果你打算报告此页面的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。

上次修改时间:2025 年 4 月 9 日下午 6:36 PST:更新 v1.32 的 API 参考文档 (a3b579d035)