diff --git a/content/zh-cn/docs/concepts/policy/resource-quotas.md b/content/zh-cn/docs/concepts/policy/resource-quotas.md index 4e765daa9a..d7ddb004da 100644 --- a/content/zh-cn/docs/concepts/policy/resource-quotas.md +++ b/content/zh-cn/docs/concepts/policy/resource-quotas.md @@ -34,7 +34,7 @@ Resource quotas are a tool for administrators to address this concern. @@ -47,14 +47,15 @@ Resource quotas work like this: 资源配额的工作方式如下: @@ -93,6 +98,7 @@ a default request for these resources. - 对于其他资源:ResourceQuota 可以工作,并且会忽略命名空间中的 Pod,而无需为该资源设置限制或请求。 这意味着,如果资源配额限制了此命名空间的临时存储,则可以创建没有限制/请求临时存储的新 Pod。 你可以使用[限制范围](/zh-cn/docs/concepts/policy/limit-range/)自动设置对这些资源的默认请求。 + {{< /note >}} - 在具有 32 GiB 内存和 16 核 CPU 资源的集群中,允许 A 团队使用 20 GiB 内存 和 10 核的 CPU 资源, @@ -119,7 +125,7 @@ Examples of policies that could be created using namespaces and quotas are: @@ -130,14 +136,14 @@ Neither contention nor changes to quota will affect already created resources. ## 启用资源配额 {#enabling-resource-quota} -资源配额的支持在很多 Kubernetes 版本中是默认启用的。 +ResourceQuota 的支持在很多 Kubernetes 版本中是默认启用的。 当 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}} 的命令行标志 `--enable-admission-plugins=` 中包含 `ResourceQuota` 时, 资源配额会被启用。 @@ -168,7 +174,7 @@ The following resource types are supported: | 资源名称 | 描述 | -| --------------------- | --------------------------------------------- | +| ------------- | ----------- | | `limits.cpu` | 所有非终止状态的 Pod,其 CPU 限额总量不能超过该值。 | | `limits.memory` | 所有非终止状态的 Pod,其内存限额总量不能超过该值。 | | `requests.cpu` | 所有非终止状态的 Pod,其 CPU 需求总量不能超过该值。 | @@ -202,10 +208,10 @@ In addition to the resources mentioned above, in release 1.10, quota support for 由于扩展资源不可超量分配,因此没有必要在配额中为同一扩展资源同时指定 `requests` 和 `limits`。 -对于扩展资源而言,目前仅允许使用前缀为 `requests.` 的配额项。 +对于扩展资源而言,仅允许使用前缀为 `requests.` 的配额项。 有关更多详细信息,请参阅[查看和设置配额](#viewing-and-setting-quotas)。 @@ -237,25 +244,25 @@ In addition, you can limit consumption of storage resources based on associated | 资源名称 | 描述 | -| --------------------- | ----------------------------------------------------------- | +| ------------- | ----------- | | `requests.storage` | 所有 PVC,存储资源的需求总量不能超过该值。 | | `persistentvolumeclaims` | 在该命名空间中所允许的 [PVC](/zh-cn/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims) 总量。 | | `.storageclass.storage.k8s.io/requests.storage` | 在所有与 `` 相关的持久卷申领中,存储请求的总和不能超过该值。 | | `.storageclass.storage.k8s.io/persistentvolumeclaims` | 在与 storage-class-name 相关的所有持久卷申领中,命名空间中可以存在的[持久卷申领](/zh-cn/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)总数。 | -例如,如果一个操作人员针对 `gold` 存储类型与 `bronze` 存储类型设置配额, -操作人员可以定义如下配额: +例如,如果你想要将 `gold` StorageClass 与 `bronze` StorageClass 分开进行存储配额配置, +则可以按如下方式定义配额: * `gold.storageclass.storage.k8s.io/requests.storage: 500Gi` * `bronze.storageclass.storage.k8s.io/requests.storage: 100Gi` @@ -267,13 +274,13 @@ In release 1.8, quota support for local ephemeral storage is added as an alpha f | 资源名称 | 描述 | -| ------------------------------- |----------------------------------------------------------- | +| ------------- | ----------- | | `requests.ephemeral-storage` | 在命名空间的所有 Pod 中,本地临时存储请求的总和不能超过此值。 | | `limits.ephemeral-storage` | 在命名空间的所有 Pod 中,本地临时存储限制值的总和不能超过此值。 | | `ephemeral-storage` | 与 `requests.ephemeral-storage` 相同。 | @@ -323,9 +330,10 @@ Here is an example set of resources users may want to put under object count quo @@ -340,7 +348,7 @@ For example, to create a quota on a `widgets` custom resource in the `example.co 定义 `scopeSelector` 时,如果使用以下值之一作为 `scopeName` 的值,则对应的 `operator` 只能是 `Exists`。 @@ -762,8 +770,8 @@ to set `namespaces` or `namespaceSelector` fields in pod affinity terms. 禁止用户使用跨名字空间的亲和性规则可能是一种被需要的能力, 因为带有反亲和性约束的 Pod 可能会阻止所有其他名字空间的 Pod 被调度到某失效域中。 @@ -795,7 +803,7 @@ spec: 如果集群运维人员希望默认禁止使用 `namespaces` 和 `namespaceSelector`, @@ -841,7 +849,7 @@ The quota can be configured to quota either value. 如果配额中指定了 `requests.cpu` 或 `requests.memory` 的值,则它要求每个容器都显式给出对这些资源的请求。 @@ -850,7 +858,7 @@ then it requires that every incoming container specifies an explicit limit for t ## 查看和设置配额 {#viewing-and-setting-quotas} @@ -947,7 +955,7 @@ services.loadbalancers 0 2 ``` kubectl 还使用语法 `count/.` 支持所有标准的、命名空间域的资源的对象计数配额: @@ -983,7 +991,7 @@ count/secrets 1 4 ## Quota and Cluster Capacity ResourceQuotas are independent of the cluster capacity. They are -expressed in absolute units. So, if you add nodes to your cluster, this does *not* +expressed in absolute units. So, if you add nodes to your cluster, this does *not* automatically give each namespace the ability to consume more resources. --> ## 配额和集群容量 {#quota-and-cluster-capacity} @@ -1022,7 +1030,7 @@ restrictions around nodes: pods from several namespaces may run on the same node ## 默认情况下限制特定优先级的资源消耗 {#limit-priority-class-consumption-by-default} @@ -1079,9 +1087,9 @@ resourcequota/pods-cluster-services created 在这里,当以下条件满足时可以创建 Pod: @@ -1101,10 +1109,11 @@ and it is to be created in a namespace other than `kube-system`. ## {{% heading "whatsnext" %}} - 参阅[资源配额设计文档](https://git.k8s.io/design-proposals-archive/resource-management/admission_control_resource_quota.md)。 - 参阅[如何使用资源配额的详细示例](/zh-cn/docs/tasks/administer-cluster/quota-api-object/)。