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 结合可能的值来表示。资源要匹配,必须同时满足作用域(scopes)和 scopeSelector(如果在 spec 中指定)。

    作用域选择器表示作用域资源选择器要求所表示的选择器的逻辑与(AND)。

    • scopeSelector.matchExpressions ([]ScopedResourceSelectorRequirement)

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

      按资源作用域划分的范围选择器要求列表。

      作用域资源选择器要求是一个选择器,包含值、作用域名称,以及将作用域名称与值关联的运算符。

      • scopeSelector.matchExpressions.operator (string), required

        表示作用域与一组值的关系。有效运算符为 In、NotIn、Exists、DoesNotExist。

        可能的枚举值

        • "DoesNotExist"
        • "Exists"
        • "In"
        • "NotIn"
      • scopeSelector.matchExpressions.scopeName (string), required

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

        可能的枚举值

        • "BestEffort" 匹配所有具有 BestEffort(尽力而为)服务质量的 Pod 对象
        • "CrossNamespacePodAffinity" 匹配所有提及了跨命名空间 Pod(反)亲和性的 Pod 对象。
        • "NotBestEffort" 匹配所有不具有 BestEffort(尽力而为)服务质量的 Pod 对象
        • "NotTerminating" 匹配所有 spec.activeDeadlineSeconds 为 nil 的 Pod 对象
        • "PriorityClass" 匹配所有提及了优先级类(PriorityClass)的 Pod 对象
        • "Terminating" 匹配所有 spec.activeDeadlineSeconds >=0 的 Pod 对象
        • "VolumeAttributesClass" 匹配所有提及了卷属性类(Volume Attributes Class)的 PVC 对象。
      • 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}

Parameters

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

    ResourceQuota 的名称

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

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

401: 未授权

get 读取指定 ResourceQuota 的状态

HTTP 请求

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

Parameters

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

    ResourceQuota 的名称

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

    命名空间

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

401: 未授权

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

HTTP 请求

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

Parameters

响应

200 (ResourceQuotaList): OK

401: 未授权

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

HTTP 请求

GET /api/v1/resourcequotas

Parameters

响应

200 (ResourceQuotaList): OK

401: 未授权

create 创建一个 ResourceQuota

HTTP 请求

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

Parameters

响应

200 (ResourceQuota): OK

201 (ResourceQuota): 已创建

202 (ResourceQuota): 已接受

401: 未授权

update 替换指定的 ResourceQuota

HTTP 请求

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

Parameters

响应

200 (ResourceQuota): OK

201 (ResourceQuota): 已创建

401: 未授权

update 替换指定 ResourceQuota 的状态

HTTP 请求

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

Parameters

响应

200 (ResourceQuota): OK

201 (ResourceQuota): 已创建

401: 未授权

patch 部分更新指定的 ResourceQuota

HTTP 请求

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

Parameters

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

    ResourceQuota 的名称

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

    命名空间

  • body: Patch, 必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (in query): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

201 (ResourceQuota): 已创建

401: 未授权

patch 部分更新指定 ResourceQuota 的状态

HTTP 请求

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

Parameters

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

    ResourceQuota 的名称

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

    命名空间

  • body: Patch, 必需

  • dryRun (在查询中): string

    dryRun

  • fieldManager (在查询中): string

    fieldManager

  • fieldValidation (在查询中): string

    fieldValidation

  • force (in query): boolean

    force

  • pretty (在查询中): string

    pretty

响应

200 (ResourceQuota): OK

201 (ResourceQuota): 已创建

401: 未授权

delete 删除一个 ResourceQuota

HTTP 请求

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

Parameters

响应

200 (ResourceQuota): OK

202 (ResourceQuota): 已接受

401: 未授权

deletecollection 删除 ResourceQuota 集合

HTTP 请求

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

Parameters

响应

200 (Status): 确定

401: 未授权


最后修改时间 2025 年 10 月 3 日下午 8:48 PST: 更新资源 API 1.34 并包含枚举值 (24e17cbfa6)

本页面是自动生成的。

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