Skip to content

Commit 42737a1

Browse files
authored
Merge pull request #38125 from my-git9/zhsync/resource-quotas.md
[zh-cn] sync concepts/policy/resource-quotas.md
2 parents 5ce295c + c705903 commit 42737a1

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

content/zh-cn/docs/concepts/policy/resource-quotas.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ Resource quotas work like this:
6666
若想避免这类问题,请参考
6767
[演练](/zh-cn/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/)示例。
6868

69+
{{< note >}}
70+
<!--
71+
- For `cpu` and `memory` resources, ResourceQuotas enforce that **every**
72+
(new) pod in that namespace sets a limit for that resource.
73+
If you enforce a resource quota in a namespace for either `cpu` or `memory`,
74+
you, and other clients, **must** specify either `requests` or `limits` for that resource,
75+
for every new Pod you submit. If you don't, the control plane may reject admission
76+
for that Pod.
77+
- For other resources: ResourceQuota works and will ignore pods in the namespace without setting a limit or request for that resource. It means that you can create a new pod without limit/request ephemeral storage if the resource quota limits the ephemeral storage of this namespace.
78+
You can use a [LimitRange](/docs/concepts/policy/limit-range/) to automatically set
79+
a default request for these resources.
80+
-->
81+
- 对于 `cpu``memory` 资源:ResourceQuota 强制该命名空间中的每个(新)Pod 为该资源设置限制。
82+
如果你在命名空间中为 `cpu``memory` 制实施资源配额,
83+
你或其他客户端**必须**为你提交的每个新 Pod 指定该资源的 `requests``limits`
84+
否则,控制平面可能会拒绝接纳该 Pod。
85+
- 对于其他资源:ResourceQuota 可以工作,并且会忽略命名空间中的 Pod,而无需为该资源设置限制或请求。
86+
这意味着,如果资源配额限制了此命名空间的临时存储,则可以创建没有限制/请求临时存储的新 Pod。
87+
你可以使用[限制范围](/zh-cn/docs/concepts/policy/limit-range/)自动设置对这些资源的默认请求。
88+
{{< /note >}}
89+
6990
<!--
7091
The name of a ResourceQuota object must be a valid
7192
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
@@ -106,7 +127,7 @@ enabled when the {{< glossary_tooltip text="API server" term_id="kube-apiserver"
106127
`--enable-admission-plugins=` flag has `ResourceQuota` as
107128
one of its arguments.
108129
-->
109-
## 启用资源配额
130+
## 启用资源配额 {#enabling-resource-quota}
110131

111132
资源配额的支持在很多 Kubernetes 版本中是默认启用的。
112133
当 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}}
@@ -126,7 +147,7 @@ You can limit the total sum of
126147
[compute resources](/docs/concepts/configuration/manage-resources-containers/)
127148
that can be requested in a given namespace.
128149
-->
129-
## 计算资源配额
150+
## 计算资源配额 {#compute-resource-quota}
130151

131152
用户可以对给定命名空间下的可被请求的
132153
[计算资源](/zh-cn/docs/concepts/configuration/manage-resources-containers/)
@@ -164,7 +185,7 @@ The following resource types are supported:
164185
In addition to the resources mentioned above, in release 1.10, quota support for
165186
[extended resources](/docs/concepts/configuration/manage-resources-containers/#extended-resources) is added.
166187
-->
167-
### 扩展资源的资源配额
188+
### 扩展资源的资源配额 {#resource-quota-for-extended-resources}
168189

169190
除上述资源外,在 Kubernetes 1.10 版本中,还添加了对
170191
[扩展资源](/zh-cn/docs/concepts/configuration/manage-resources-containers/#extended-resources)
@@ -199,7 +220,7 @@ You can limit the total sum of [storage resources](/docs/concepts/storage/persis
199220
200221
In addition, you can limit consumption of storage resources based on associated storage-class.
201222
-->
202-
## 存储资源配额
223+
## 存储资源配额 {#storage-resource-quota}
203224

204225
用户可以对给定命名空间下的[存储资源](/zh-cn/docs/concepts/storage/persistent-volumes/)
205226
总量进行限制。
@@ -270,7 +291,7 @@ namespaced resource types using the following syntax:
270291
* `count/<resource>.<group>` for resources from non-core groups
271292
* `count/<resource>` for resources from the core group
272293
-->
273-
## 对象数量配额
294+
## 对象数量配额 {#object-count-quota}
274295

275296
你可以使用以下语法对所有标准的、命名空间域的资源类型进行配额设置:
276297

@@ -472,7 +493,7 @@ specified.
472493
<!--
473494
### Resource Quota Per PriorityClass
474495
-->
475-
### 基于优先级类(PriorityClass)来设置资源配额
496+
### 基于优先级类(PriorityClass)来设置资源配额 {#resource-quota-per-priorityclass}
476497

477498
{{< feature-state for_k8s_version="v1.17" state="stable" >}}
478499

@@ -979,7 +1000,7 @@ restrictions around nodes: pods from several namespaces may run on the same node
9791000
It may be desired that pods at a particular priority, eg. "cluster-services",
9801001
should be allowed in a namespace, if and only if, a matching quota object exists.
9811002
-->
982-
## 默认情况下限制特定优先级的资源消耗
1003+
## 默认情况下限制特定优先级的资源消耗 {#limit-priority-class-consumption-by-default}
9831004
9841005
有时候可能希望当且仅当某名字空间中存在匹配的配额对象时,才可以创建特定优先级
9851006
(例如 "cluster-services")的 Pod。

0 commit comments

Comments
 (0)