website/content/zh-cn/docs/reference/kubernetes-api/policy-resources/resource-quota-v1.md

24 KiB
Raw Blame History

api_metadata content_type description title weight
apiVersion import kind
v1 k8s.io/api/core/v1 ResourceQuota
api_reference ResourceQuota 设置每个命名空间强制执行的聚合配额限制。 ResourceQuota 2

apiVersion: v1

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

ResourceQuota

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


ResourceQuotaSpec

ResourceQuotaSpec 定义为 Quota 强制执行所需的硬限制。


  • hard (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity)

    hard 是每种指定资源所需的硬性限制集合。 更多信息: https://kubernetes.io/docs/concepts/policy/resource-quotas/

  • scopeSelector (ScopeSelector)

    scopeSelector 也是一组过滤器的集合,和 scopes 类似, 必须匹配配额所跟踪的每个对象,但使用 ScopeSelectorOperator 结合可能的值来表示。 对于要匹配的资源,必须同时匹配 scopes 和 scopeSelector如果在 spec 中设置了的话)。

    scope 选择算符表示的是由限定范围的资源选择算符进行 逻辑与 计算得出的结果。

    • scopeSelector.matchExpressions ([]ScopedResourceSelectorRequirement)

      按资源范围划分的范围选择算符需求列表。

      限定范围的资源选择算符需求是一种选择算符,包含值、范围名称和将二者关联起来的运算符。

      • scopeSelector.matchExpressions.operator (string),必需

        表示范围与一组值之间的关系。有效的运算符为 In、NotIn、Exists、DoesNotExist。

      • scopeSelector.matchExpressions.scopeName (string),必需

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

      • scopeSelector.matchExpressions.values ([]string)

        字符串值数组。 如果操作符是 In 或 NotInvalues 数组必须是非空的。 如果操作符是 Exists 或 DoesNotExistvalues 数组必须为空。 该数组将在策略性合并补丁操作期间被替换。

  • scopes ([]string)

    一个匹配被配额跟踪的所有对象的过滤器集合。 如果没有指定,则默认匹配所有对象。

ResourceQuotaStatus

ResourceQuotaStatus 定义硬性限制和观测到的用量。


  • hard (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity)

    hard 是每种指定资源所强制实施的硬性限制集合。 更多信息: https://kubernetes.io/docs/concepts/policy/resource-quotas/

  • used (map[string]<a href="{{< ref "../common-definitions/quantity#Quantity" >}}">Quantity)

    used 是当前命名空间中所观察到的资源总用量。

ResourceQuotaList

ResourceQuotaList 是 ResourceQuota 列表。


操作


get 读取指定的 ResourceQuota

HTTP 请求

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

参数

  • name 路径参数: string, 必需

    ResourceQuota 的名称

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

401: Unauthorized

get 读取指定的 ResourceQuota 的状态

HTTP 请求

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

参数

  • name 路径参数: string, 必需

    ResourceQuota 的名称

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

401: Unauthorized

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

HTTP 请求

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

参数

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • allowWatchBookmarks 查询参数: boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch 查询参数: boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuotaList" >}}">ResourceQuotaList): OK

401: Unauthorized

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

HTTP 请求

GET /api/v1/resourcequotas

参数

  • allowWatchBookmarks 查询参数: boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch 查询参数: boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuotaList" >}}">ResourceQuotaList): OK

401: Unauthorized

create 创建一个 ResourceQuota

HTTP 请求

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

参数

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota, 必需

  • dryRun 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

201 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): Created

202 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): Accepted

401: Unauthorized

update 更新指定的 ResourceQuota

HTTP 请求

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

参数

  • name 路径参数: string, 必需

    ResourceQuota 的名称

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota, 必需

  • dryRun 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

201 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): Created

401: Unauthorized

update 更新指定 ResourceQuota 的状态

HTTP 请求

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

参数

  • name 路径参数: string, 必需

    ResourceQuota 的名称

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota, 必需

  • dryRun 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

201 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): Created

401: Unauthorized

patch 部分更新指定的 ResourceQuota

HTTP 请求

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

参数

  • name 路径参数: string, 必需

    ResourceQuota 的名称

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch, 必需

  • dryRun 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • force 查询参数: boolean

    <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

201 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): Created

401: Unauthorized

patch 部分更新指定 ResourceQuota 的状态

HTTP 请求

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

参数

  • name 路径参数: string, 必需

    ResourceQuota 的名称

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch, 必需

  • dryRun 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • force 查询参数: boolean

    <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

201 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): Created

401: Unauthorized

delete 删除 ResourceQuota

HTTP 请求

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

参数

  • name 路径参数: string, 必需

    ResourceQuota 的名称

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • dryRun 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • gracePeriodSeconds 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

响应

200 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): OK

202 (<a href="{{< ref "../policy-resources/resource-quota-v1#ResourceQuota" >}}">ResourceQuota): Accepted

401: Unauthorized

deletecollection 删除 ResourceQuota 的集合

HTTP 请求

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

参数

  • namespace 路径参数: string, 必需

    <a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • continue 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • dryRun 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldSelector 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • gracePeriodSeconds 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • labelSelector 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

  • resourceVersion 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch 查询参数: string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数): boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds 查询参数: integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

401: Unauthorized