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 也是一组过滤器,如必须匹配配额所跟踪的每个对象的范围,但使用 ScopeSelectorOperator 与可能的值结合表示。要使资源匹配,必须同时匹配范围 AND scopeSelector(如果在 spec 中指定)。

    范围选择器表示由范围资源选择器要求所表示的选择器的 AND 运算。

    • scopeSelector.matchExpressions ([]ScopedResourceSelectorRequirement)

      原子性:在合并期间将被替换

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

      范围资源选择器需求是一个选择器,它包含值、范围名称以及将范围名称与值相关联的操作符。

      • scopeSelector.matchExpressions.operator (string), required

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

      • scopeSelector.matchExpressions.scopeName (string), required

        选择器适用的范围的名称。

      • scopeSelector.matchExpressions.values ([]string)

        原子性:在合并期间将被替换

        字符串值数组。如果操作符是 In 或 NotIn,则 values 数组不能为空。如果操作符是 Exists 或 DoesNotExist,则 values 数组必须为空。此数组在战略合并补丁期间被替换。

  • scopes ([]string)

    原子性:在合并期间将被替换

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

ResourceQuotaStatus

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


ResourceQuotaList

ResourceQuotaList 是 ResourceQuota 项的列表。


操作


get 读取指定的 ResourceQuota

HTTP 请求

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

参数

  • name (在路径中): string,必填

    ResourceQuota 的名称

  • namespace (在路径中): string,必填

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

401: 未授权

get 读取指定 ResourceQuota 的状态

HTTP 请求

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

参数

  • name (在路径中): string,必填

    ResourceQuota 的名称

  • namespace (在路径中): string,必填

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

401: 未授权

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

HTTP 请求

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

参数

响应

200 (ResourceQuotaList): OK

401: 未授权

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

HTTP 请求

GET /api/v1/resourcequotas

参数

响应

200 (ResourceQuotaList): OK

401: 未授权

create 创建一个 ResourceQuota

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

202 (ResourceQuota): Accepted

401: 未授权

update 替换指定的 ResourceQuota

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: 未授权

update 替换指定 ResourceQuota 的状态

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: 未授权

patch 部分更新指定的 ResourceQuota

HTTP 请求

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

参数

  • name (在路径中): string,必填

    ResourceQuota 的名称

  • namespace (在路径中): string,必填

    命名空间

  • body: Patch,必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: 未授权

patch 部分更新指定 ResourceQuota 的状态

HTTP 请求

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

参数

  • name (在路径中): string,必填

    ResourceQuota 的名称

  • namespace (在路径中): string,必填

    命名空间

  • body: Patch,必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (在查询中): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

201 (ResourceQuota): Created

401: 未授权

delete 删除一个 ResourceQuota

HTTP 请求

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

参数

响应

200 (ResourceQuota): OK

202 (ResourceQuota): Accepted

401: 未授权

deletecollection 删除 ResourceQuota 的集合

HTTP 请求

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

参数

响应

200 (Status): OK

401: 未授权

本页面是自动生成的。

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

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